css-minimizer-webpack-plugin
css-minimizer-webpack-plugin copied to clipboard
Hash output asset.css does not change
- Operating System: Ubuntu
- Node Version: 12.16.1
- NPM Version: 6.14.7
- webpack Version: 4 / 5
- css-minimizer-webpack-plugin Version: 1.0.0
Expected Behavior
- Run webpack with the provided config
- Get output asset
entry.40909804e9379fa0a37f.css
- Change
minimizerOptions
- Run webpack
- Get output asset
entry.other_hash.css
Actual Behavior
- Run webpack with the provided config
- Get output asset
entry.40909804e9379fa0a37f.css
- Change
minimizerOptions
- Run webpack
- Get output asset
entry.40909804e9379fa0a37f.css
Hash does not change.
Code
module.exports = {
...
module: {
loaders: [
{
test: /.s?css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].[contentHash].css',
chunkFilename: '[id].[name].[contentHash].css',
}),
],
optimization: {
minimize: true,
minimizer: [
new CssMinimizerPlugin({
minimizerOptions: {
// When we change these options, the hash of the asset should also change
preset: ['default', { discardEmpty: false }],
},
})
],
},
};
We have also encountered this issue and hope that the plugin can support content hash updates.