Skip to content

Commit 88bc50a

Browse files
ryansullyromaindso
authored andcommitted
Add navigateFallbackWhitelist /__* to SW Precache config (facebook#2347)
* Add navigateFallbackWhitelist /__* to SW Precache config * Add comments
1 parent 3d05ec2 commit 88bc50a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/react-scripts/config/webpack.config.prod.js

+5
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,12 @@ module.exports = {
319319
console.log(message);
320320
},
321321
minify: true,
322+
// For unknown URLs, fallback to the index page
322323
navigateFallback: publicUrl + '/index.html',
324+
// Ignores URLs starting from /__ (useful for Firebase):
325+
// https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219
326+
navigateFallbackWhitelist: [/^(?!\/__).*/],
327+
// Don't precache sourcemaps (they're large) and build asset manifest:
323328
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
324329
// Work around Windows path issue in SWPrecacheWebpackPlugin:
325330
// https://github.com/facebookincubator/create-react-app/issues/2235

0 commit comments

Comments
 (0)