-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
extract multiple css files but created a unnecessary js file. #279
Comments
It's a known bug in |
@michael-ciniawsky It isn't webpack bug. I think MiniCssExtractPlugin should remove assets. plugins: [
new HtmlWebpackPlugin({
template: resolve(SRC_DIR, './index.html'),
inject: 'head',
minify: IS_PRODUCTION,
hash: true,
}),
new MiniCssExtractPlugin({
filename: '[name].css',
hmr: !IS_PRODUCTION,
}),
{
apply(compiler) {
compiler.hooks.shouldEmit.tap('Remove styles from output', (compilation) => {
delete compilation.assets['styles.js']; // Remove asset. Name of file depends of your entries and
return true;
})
}
}
], |
the file is no longer created, but a tag with the path to the file is generated. |
causes
|
I want to extract multiple css files base on "src" and "node_modules" paths with specific output path.
![image](https://user-images.githubusercontent.com/5137237/45732069-3e436100-bc0d-11e8-9909-ad15e9d0541d.png)
I try to use splitChunks.cacheGroups but it create two files whitin js and css folders.
I don't need the xxx.styles.js file, it's unnecessary. how could I fix it? thanks.
xxx.styles.js:
The text was updated successfully, but these errors were encountered: