{
test: /\.module\.scss$/,
use: [
{ loader: MiniCssExtractPlugin.loader, options: { publicPath: '../' } },
{
loader: 'css-loader',
options: {
modules: { localIdentName: '[local]---[hash:base64:5]' }
}
},
'sass-loader',
{
loader: 'sass-resources-loader',
options: {
resources: './src/css/_variables.scss'
}
}
]
},
{
test: /\.scss$/,
exclude: /\.module\.scss$/,
use: [
{ loader: MiniCssExtractPlugin.loader, options: { publicPath: '../' } },
'css-loader',
'sass-loader'
]
},
...
plugins: [
new MiniCssExtractPlugin({
filename: 'css/bundle.css'
})
]
I am creating a single css file that includes some vanilla sass styles and some css module styles. Is there a way to control this so that the module css comes AFTER the regular css in the outputted bundle.css file? It's always before it right now.
I've tried reordering them in the package.json. I've tried using oneOf.
main.scss
and have that import all the files in the exact order you need. (remember that sass can import plain CSS files just fine) – Bradleybradly