Skip to content

Commit 8b5626d

Browse files
author
Ives van Hoorne
committed
Fix service worker cache busting
1 parent 784af91 commit 8b5626d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

config/webpack.prod.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const publicPath = '/';
88
module.exports = merge(commonConfig, {
99
devtool: 'source-map',
1010
output: {
11-
filename: 'static/js/[name].[chunkhash].js',
12-
chunkFilename: 'static/js/[name].[chunkhash].chunk.js',
11+
filename: 'static/js/[name].[chunkhash:8].js',
12+
chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js',
1313
sourceMapFilename: '[file].map', // Default
1414
},
1515
plugins: [
@@ -107,6 +107,7 @@ module.exports = merge(commonConfig, {
107107
// about it being stale, and the cache-busting can be skipped.
108108
dontCacheBustUrlsMatching: /\.\w{8}\./,
109109
filename: 'sandbox-service-worker.js',
110+
cacheId: 'code-sandbox-sandbox',
110111
logger(message) {
111112
if (message.indexOf('Total precache size is') === 0) {
112113
// This message occurs for every build and is a bit too noisy.
@@ -124,7 +125,6 @@ module.exports = merge(commonConfig, {
124125
navigateFallback: 'https://new.codesandbox.io/frame.html',
125126
staticFileGlobs: ['www/frame.html'],
126127
stripPrefix: 'www/',
127-
cacheId: 'code-sandbox-sandbox',
128128
// Ignores URLs starting from /__ (useful for Firebase):
129129
// https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219
130130
navigateFallbackWhitelist: [/^(?!\/__).*/],
@@ -211,6 +211,5 @@ module.exports = merge(commonConfig, {
211211
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
212212
// You can remove this if you don't use Moment.js:
213213
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
214-
new webpack.optimize.ModuleConcatenationPlugin(),
215214
],
216215
});

0 commit comments

Comments
 (0)