0

In webpack, I can make bundle to be named as hash, like this:

output: {
    path: resolvePath('dist'),
    filename: '[name].[contenthash].js'
  },

This generates files like:

34.9e884d9e0051cf81aff5.js
bundle.936eb50aa67577f751e6.js
vendors.df56297c28c1d1017f2a.js

But css files are not getting hashed they remain:

bundle.css

The problem comes when I am using caching in my server and changes are not getting applied since css files are not getting renamed.

How to tell webpack to create something like 9e884d9e0051cf81aff5.bundle.css ?

1 Answer 1

1

I suppose you're using this mini-css-extract-plugin?

new MiniCssExtractPlugin({
 filename: '[contenthash].bundle.css'
}),
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.