-
Hi, how about adding an hash on compiled css and js when deploying to production? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @dangelion If you want provide global hash to files, just simply turn in ON ( Another way to deal with it is to add manualny generated hash for your output file name, for example: Without hash app.js: With 6-char hash: Hope I helped you. |
Beta Was this translation helpful? Give feedback.
-
@dangelion are you OK with the answer from @mukaspc? |
Beta Was this translation helpful? Give feedback.
-
Note - turning on hash only works on images and fonts in the default webpack config. The generated js and css file is untouched. I was able to change it for js and css by adding (the missing) [hash:6] to the filenames. |
Beta Was this translation helpful? Give feedback.
Hi @dangelion
If you want provide global hash to files, just simply turn in ON (
hash: true
) forHTMLWebpackPlugin
method at the beginning of thewebpack.config.js
Another way to deal with it is to add manualny generated hash for your output file name, for example:
Without hash app.js:
filename: 'js/[name].js'
With 6-char hash:
filename: 'js/[name].[hash:6].js'
Hope I helped you.
Best