Skip to content

Commit

Permalink
Invalidate all old HTTP caches
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Aug 19, 2024
1 parent 902dc5c commit 9eb1121
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const htmlWebpackPluginCommon = {
APP_NAME
};

// Change this number to bypass all old HTTP caches
const CACHE_EPOCH = 2;

const base = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
devtool: process.env.SOURCEMAP || (process.env.NODE_ENV === 'production' ? false : 'cheap-module-source-map'),
Expand All @@ -47,8 +50,8 @@ const base = {
},
output: {
library: 'GUI',
filename: process.env.NODE_ENV === 'production' ? 'js/[name].[contenthash].js' : 'js/[name].js',
chunkFilename: process.env.NODE_ENV === 'production' ? 'js/[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: {
Expand Down

0 comments on commit 9eb1121

Please sign in to comment.