Commit 3aeec210 authored by Lukas Eipert's avatar Lukas Eipert Committed by Mike Greiling

Webpack: Use contenthash for hash generation

parent 6717786f
...@@ -141,8 +141,8 @@ module.exports = { ...@@ -141,8 +141,8 @@ module.exports = {
output: { output: {
path: path.join(ROOT_PATH, 'public/assets/webpack'), path: path.join(ROOT_PATH, 'public/assets/webpack'),
publicPath: '/assets/webpack/', publicPath: '/assets/webpack/',
filename: IS_PRODUCTION ? '[name].[chunkhash:8].bundle.js' : '[name].bundle.js', filename: IS_PRODUCTION ? '[name].[contenthash:8].bundle.js' : '[name].bundle.js',
chunkFilename: IS_PRODUCTION ? '[name].[chunkhash:8].chunk.js' : '[name].chunk.js', chunkFilename: IS_PRODUCTION ? '[name].[contenthash:8].chunk.js' : '[name].chunk.js',
globalObject: 'this', // allow HMR and web workers to play nice globalObject: 'this', // allow HMR and web workers to play nice
}, },
...@@ -191,7 +191,7 @@ module.exports = { ...@@ -191,7 +191,7 @@ module.exports = {
test: /icons\.svg$/, test: /icons\.svg$/,
loader: 'file-loader', loader: 'file-loader',
options: { options: {
name: '[name].[hash:8].[ext]', name: '[name].[contenthash:8].[ext]',
}, },
}, },
{ {
...@@ -210,7 +210,7 @@ module.exports = { ...@@ -210,7 +210,7 @@ module.exports = {
{ {
loader: 'worker-loader', loader: 'worker-loader',
options: { options: {
name: '[name].[hash:8].worker.js', name: '[name].[contenthash:8].worker.js',
inline: IS_DEV_SERVER, inline: IS_DEV_SERVER,
}, },
}, },
...@@ -222,7 +222,7 @@ module.exports = { ...@@ -222,7 +222,7 @@ module.exports = {
exclude: /node_modules/, exclude: /node_modules/,
loader: 'file-loader', loader: 'file-loader',
options: { options: {
name: '[name].[hash:8].[ext]', name: '[name].[contenthash:8].[ext]',
}, },
}, },
{ {
...@@ -232,7 +232,7 @@ module.exports = { ...@@ -232,7 +232,7 @@ module.exports = {
{ {
loader: 'css-loader', loader: 'css-loader',
options: { options: {
name: '[name].[hash:8].[ext]', name: '[name].[contenthash:8].[ext]',
}, },
}, },
], ],
...@@ -242,13 +242,15 @@ module.exports = { ...@@ -242,13 +242,15 @@ module.exports = {
include: /node_modules\/katex\/dist\/fonts/, include: /node_modules\/katex\/dist\/fonts/,
loader: 'file-loader', loader: 'file-loader',
options: { options: {
name: '[name].[hash:8].[ext]', name: '[name].[contenthash:8].[ext]',
}, },
}, },
], ],
}, },
optimization: { optimization: {
// Replace 'hashed' with 'deterministic' in webpack 5
moduleIds: 'hashed',
runtimeChunk: 'single', runtimeChunk: 'single',
splitChunks: { splitChunks: {
maxInitialRequests: 4, maxInitialRequests: 4,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment