Webpack: only use [chunkhash] and [contenthash] in production builds

https://webpack.js.org/guides/build-performance/#avoid-production-specific-tooling
This commit is contained in:
Alex Gleason 2022-09-30 12:03:10 -05:00
parent ce255b7ded
commit d162bc5d17
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 10 additions and 3 deletions

View file

@ -17,6 +17,13 @@ module.exports = merge(sharedConfig, {
devtool: 'source-map',
stats: 'errors-warnings',
bail: true,
output: {
filename: 'packs/js/[name]-[chunkhash].js',
chunkFilename: 'packs/js/[name]-[chunkhash].chunk.js',
hotUpdateChunkFilename: 'packs/js/[id]-[contenthash].hot-update.js',
},
optimization: {
minimize: true,
},

View file

@ -52,9 +52,9 @@ module.exports = {
},
output: {
filename: 'packs/js/[name]-[chunkhash].js',
chunkFilename: 'packs/js/[name]-[chunkhash].chunk.js',
hotUpdateChunkFilename: 'packs/js/[id]-[contenthash].hot-update.js',
filename: 'packs/js/[name].js',
chunkFilename: 'packs/js/[name].chunk.js',
hotUpdateChunkFilename: 'packs/js/[id].hot-update.js',
path: output.path,
publicPath: join(FE_SUBDIRECTORY, '/'),
},