From e069e35d26c49b673c397d9fa1377a2989d366d4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 29 Aug 2017 21:13:09 +0200 Subject: [PATCH 1/2] sw-precache: don't fallback if URL starts with /api --- packages/react-scripts/config/webpack.config.prod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 44964346107..550d5c86946 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -340,7 +340,7 @@ module.exports = { navigateFallback: publicUrl + '/index.html', // Ignores URLs starting from /__ (useful for Firebase): // https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219 - navigateFallbackWhitelist: [/^(?!\/__).*/], + navigateFallbackWhitelist: [/^(?!\/(__|api)).*/], // Don't precache sourcemaps (they're large) and build asset manifest: staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/], }), From 74b9dc432754ed729b4c495376be8015be05e5ef Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 30 Aug 2017 07:50:58 +0200 Subject: [PATCH 2/2] sw-precache: add comment for no fallback /api --- packages/react-scripts/config/webpack.config.prod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 550d5c86946..da9ad7ca355 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -338,7 +338,7 @@ module.exports = { minify: true, // For unknown URLs, fallback to the index page navigateFallback: publicUrl + '/index.html', - // Ignores URLs starting from /__ (useful for Firebase): + // Ignores URLs starting from /api or /__ (useful for Firebase): // https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219 navigateFallbackWhitelist: [/^(?!\/(__|api)).*/], // Don't precache sourcemaps (they're large) and build asset manifest: