-
-
Notifications
You must be signed in to change notification settings - Fork 163
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
This is a behavior that was probably in place forever with uglify hence it remains with terser as well.
versions
- webpack Version: 4.20.1
- terser-webpack-plugin Version: 1.1.0
config
output: {
filename = 'myprefix.[name].[contenthash].js',
chunkFilename = 'myprefix.[name].[contenthash].js'
},
optimization: {
- minimize: false,
+ minimize: true,
minimizer: [new TerserPlugin()],
}Expected Behavior
- When minification is on,
contenthashof the output files should be different compared to when it is off
Actual Behavior
- Regardless if minification is on or off, same
contenthashis generated. i.e. file names are the same
This is problematic in case of scenario of upgrading the minificator.
- Since minification has no impact on the final file name, minifying with plugin version N vs plugin version N+1 might yield different content out of the same input file, yet same file name.
- Problematic in scope of long term caching, particularly in case of a bug in minificator. This can yield weird problems in deployment pipelines, CDNs etc. or lead to situation where different users have file with same name but different contents, depending on when they access the files and how the caching headers are configured.
To sum up, hard to diagnose bugs can happen if you're not aware of this issue.
According to webpack/webpack#7483 (comment)
plugin should regenerate
contenthashif they change content of file
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working