From c4d12b24842b0bb62132ab5cb333efcbd0aae2d9 Mon Sep 17 00:00:00 2001 From: Muffin Date: Mon, 19 Aug 2024 22:18:32 -0500 Subject: [PATCH] Use subdirectory instead of hyphen for cache epoch Simplifies backend's cache-control header logic a bit if we keep everything in js/ The epoch is now a word so we can put easter eggs in there --- webpack.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index e3eb57abcf2..f67a63c5413 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -25,8 +25,8 @@ const htmlWebpackPluginCommon = { APP_NAME }; -// Change this number to bypass all old HTTP caches -const CACHE_EPOCH = 2; +// When this changes, the path for all JS files will change, bypassing any HTTP caches +const CACHE_EPOCH = 'gleba'; const base = { mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', @@ -50,8 +50,8 @@ const base = { }, output: { library: 'GUI', - filename: process.env.NODE_ENV === 'production' ? `js-${CACHE_EPOCH}/[name].[contenthash].js` : 'js/[name].js', - chunkFilename: process.env.NODE_ENV === 'production' ? `js-${CACHE_EPOCH}/[name].[contenthash].js` : 'js/[name].js', + filename: process.env.NODE_ENV === 'production' ? `js/${CACHE_EPOCH}/[name].[contenthash].js` : 'js/[name].js', + chunkFilename: process.env.NODE_ENV === 'production' ? `js/${CACHE_EPOCH}/[name].[contenthash].js` : 'js/[name].js', publicPath: root }, resolve: {