-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(webpack) correct MiniCssExtractPlugin fix: #18 #19
Conversation
@Sayan751 can you help to review? |
@avrahamcool Thanks for the PR. Can you please add some details, as why the previous configuration was problematic? |
@avrahamcool @3cp Although I fundamentally don't see any problem with the current PR, I could not unfortunately reproduce the issue. It would be nice to see the reproduction of the original issue. |
I'll create a small repo for that. |
Thanks @avrahamcool , that would be really helpful! |
@Sayan751 https://github.com/avrahamcool/webpack-bundling-problem |
@avrahamcool Thanks for the repo. This has helped me understanding the issue. Also found this, which explains the root cause of the issue. @3cp The proposed change looks good to me. For completeness, let me say that there is another alternative. I was also playing with the webpack options. IMO it is not that bad to classify the assets into different directories like {
module: {
rules: [
{
test: /\.css$/i,
issuer: [{ not: [{ test: /\.html$/i }] }],
use: extractCss ? [{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: '../' // <-- L1.1
}
}, ...cssRules
] : ['style-loader', ...cssRules]
},
{
test: /\.(png|gif|jpg|cur)$/i,
loader: 'url-loader',
options: {
limit: 8192,
name: 'images/[hash].[ext]' // <-- L2
}
},
]
},
plugins: [
new MiniCssExtractPlugin({
filename: production ? 'css/[name].[contenthash].bundle.css' : 'css/[name].[hash].bundle.css', //<-- L1.2
chunkFilename: production ? 'css/[name].[contenthash].chunk.css' : 'css/[name].[hash].chunk.css' //<-- L1.3
})
]
} Note that in L1.2, and L1.3 we are pushing the extracted css files to the |
Thank you both! |
No description provided.