From 55fe1369d700066f118884bb4205073143101591 Mon Sep 17 00:00:00 2001 From: Ryan Sullivan Date: Wed, 24 May 2017 05:07:45 -0700 Subject: [PATCH] Add navigateFallbackWhitelist /__* to SW Precache config (#2347) * Add navigateFallbackWhitelist /__* to SW Precache config * Add comments --- packages/react-scripts/config/webpack.config.prod.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 3de2775e030..446fd5ca39d 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -319,7 +319,12 @@ module.exports = { console.log(message); }, minify: true, + // For unknown URLs, fallback to the index page navigateFallback: publicUrl + '/index.html', + // Ignores URLs starting from /__ (useful for Firebase): + // https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219 + navigateFallbackWhitelist: [/^(?!\/__).*/], + // Don't precache sourcemaps (they're large) and build asset manifest: staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/], // Work around Windows path issue in SWPrecacheWebpackPlugin: // https://github.com/facebookincubator/create-react-app/issues/2235