-
-
Notifications
You must be signed in to change notification settings - Fork 388
Closed
Description
Good day, we moved from 2.6 webpack to 4.28.4. It's a big bump and of course we migrated from old css plugin to new mini-css-extract-plugin. However, it doesn't bundle css properly anymore, which causes wrong render
We have dozens of the next warnings. Seems like something is wrong with optimization of chunks of css
WARNING in chunk bootstrap [mini-css-extract-plugin]
Conflicting order between:
* css ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/styles/components/1.scss
* css ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/styles/components/2.scss
* css ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/styles/components/3.scss
* css ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/styles/components/4.scss
rule is
{
test: /\.s?css$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader'
]
}
optimization looks like
optimization: {
splitChunks: {
name: 'bootstrap',
minChunks: Infinity,
cacheGroups: {
bootstrap: {
filename: '[name].[chunkhash].js'
},
styles: {
name: 'styles',
test: /\.css$/,
chunks: 'all',
enforce: true
}
}
}
},
plugins is
new MiniCssExtractPlugin({ filename: 'style.css' })
if I replace MiniCssExtractPlugin.loader
with style-loader
, it seems to be switched off and error no longer appears, except I have no static/style.css
file generated and all styles become inlined
devuxer
Metadata
Metadata
Assignees
Labels
No labels