Skip to content
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

Hash output asset.css does not change #14

Open
cap-Bernardito opened this issue Aug 1, 2020 · 1 comment
Open

Hash output asset.css does not change #14

cap-Bernardito opened this issue Aug 1, 2020 · 1 comment

Comments

@cap-Bernardito
Copy link
Member

cap-Bernardito commented Aug 1, 2020

  • 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

  1. Run webpack with the provided config
  2. Get output asset entry.40909804e9379fa0a37f.css
  3. Change minimizerOptions
  4. Run webpack
  5. Get output asset entry.other_hash.css

Actual Behavior

  1. Run webpack with the provided config
  2. Get output asset entry.40909804e9379fa0a37f.css
  3. Change minimizerOptions
  4. Run webpack
  5. 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 }],
        },
      })
    ],
  },
};
@yanghuabei
Copy link

We have also encountered this issue and hope that the plugin can support content hash updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants