Fix webpack config for bundle caching

This commit is contained in:
Bill Thornton 2021-07-14 15:33:30 -04:00
parent 10c07df84c
commit 4bb8102ca7

View file

@ -33,7 +33,9 @@ module.exports = {
new CleanWebpackPlugin(), new CleanWebpackPlugin(),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
filename: 'index.html', filename: 'index.html',
template: 'index.html' template: 'index.html',
// Append file hashes to bundle urls for cache busting
hash: true
}), }),
new CopyPlugin({ new CopyPlugin({
patterns: [ patterns: [
@ -75,7 +77,8 @@ module.exports = {
}) })
], ],
output: { output: {
filename: '[name].[contenthash].bundle.js', filename: '[name].bundle.js',
chunkFilename: '[name].[contenthash].chunk.js',
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
publicPath: '' publicPath: ''
}, },