From 4bb8102ca710ffca1c798225c72507f6cf64f525 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 14 Jul 2021 15:33:30 -0400 Subject: [PATCH] Fix webpack config for bundle caching --- webpack.common.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index 2a21ffce2..f3a522588 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -33,7 +33,9 @@ module.exports = { new CleanWebpackPlugin(), new HtmlWebpackPlugin({ filename: 'index.html', - template: 'index.html' + template: 'index.html', + // Append file hashes to bundle urls for cache busting + hash: true }), new CopyPlugin({ patterns: [ @@ -75,7 +77,8 @@ module.exports = { }) ], output: { - filename: '[name].[contenthash].bundle.js', + filename: '[name].bundle.js', + chunkFilename: '[name].[contenthash].chunk.js', path: path.resolve(__dirname, 'dist'), publicPath: '' },