Skip to content

Commit 306fdf2

Browse files
committed
Split entry and non-entry filename templates into two
We'll need this when we add Monaco, but it appears to be more correct to use it consistently anyway.
1 parent b059aaf commit 306fdf2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

ui/frontend/webpack.config.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,22 @@ const allKeybindings = allKeybindingNames.concat(['ace']).sort();
2525
const allThemes = allThemeNames;
2626

2727
// The name is nicer to debug with, but changing names breaks long-term-caching
28-
const developmentFilenameTemplate = '[name]-[chunkhash]';
29-
const productionFilenameTemplate = '[chunkhash]';
28+
const developmentFilenameTemplate = '[name]-[contenthash]';
29+
const developmentChunkFilenameTemplate = '[name]-[chunkhash]';
30+
31+
const productionFilenameTemplate = '[contenthash]';
32+
const productionChunkFilenameTemplate = '[chunkhash]';
3033

3134
module.exports = function(_, argv) {
3235
const isProduction = argv.mode === 'production';
3336
const filenameTemplate =
3437
isProduction ?
3538
productionFilenameTemplate :
3639
developmentFilenameTemplate;
40+
const chunkFilenameTemplate =
41+
isProduction ?
42+
productionChunkFilenameTemplate :
43+
developmentChunkFilenameTemplate;
3744

3845
const devtool =
3946
isProduction ?
@@ -61,7 +68,7 @@ module.exports = function(_, argv) {
6168
publicPath: 'assets/',
6269
path: `${__dirname}/build/assets`,
6370
filename: `${filenameTemplate}.js`,
64-
chunkFilename: `${filenameTemplate}.js`,
71+
chunkFilename: `${chunkFilenameTemplate}.js`,
6572
},
6673

6774
resolve: {
@@ -137,7 +144,7 @@ module.exports = function(_, argv) {
137144
}),
138145
new MiniCssExtractPlugin({
139146
filename: `${filenameTemplate}.css`,
140-
chunkFilename: `${filenameTemplate}.css`,
147+
chunkFilename: `${chunkFilenameTemplate}.css`,
141148
}),
142149
...(isProduction ? [new CompressionPlugin()] : []),
143150
],

0 commit comments

Comments
 (0)