File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
packages/react-scripts/config Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ const shouldUseRelativeAssetPaths = publicPath === './';
35
35
const publicUrl = publicPath . slice ( 0 , - 1 ) ;
36
36
// Get environment variables to inject into our app.
37
37
const env = getClientEnvironment ( publicUrl ) ;
38
+ // Get packageName from package.json
39
+ const packageName = require ( paths . appPackageJson ) . name ;
38
40
39
41
// Assert this just to be safe.
40
42
// Development builds of React are slow and not intended for production.
@@ -311,7 +313,7 @@ module.exports = {
311
313
// If a URL is already hashed by Webpack, then there is no concern
312
314
// about it being stale, and the cache-busting can be skipped.
313
315
dontCacheBustUrlsMatching : / \. \w { 8 } \. / ,
314
- filename : ' service-worker.js' ,
316
+ filename : ` service-worker- ${ packageName } .js` ,
315
317
logger ( message ) {
316
318
if ( message . indexOf ( 'Total precache size is' ) === 0 ) {
317
319
// This message occurs for every build and is a bit too noisy.
You can’t perform that action at this time.
0 commit comments