From c905548abb445ba4377d5f6b4acf3698b8813a16 Mon Sep 17 00:00:00 2001 From: Maximilian Stoiber Date: Mon, 25 Jun 2018 20:21:43 +0200 Subject: [PATCH 1/3] Stop ServiceWorker from returning app shell for /auth and /api Fixes breaking bug in prod --- config-overrides.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config-overrides.js b/config-overrides.js index 3917f336ef..b1a0e4f8c3 100644 --- a/config-overrides.js +++ b/config-overrides.js @@ -108,6 +108,16 @@ module.exports = function override(config, env) { caches: process.env.NODE_ENV === 'development' ? {} : 'all', externals, autoUpdate: true, + cacheMaps: [ + { + match(url) { + const EXTERNAL_PATHS = ['/api', '/auth']; + if (EXTERNAL_PATHS.some(path => url.pathname.indexOf(path) === 0)) + return false; + return url; + }, + }, + ], rewrites: arg => arg, ServiceWorker: { entry: './public/push-sw.js', From fffc6ffbcb14d03e2d5b581455ed104f0d4d87fe Mon Sep 17 00:00:00 2001 From: Maximilian Stoiber Date: Mon, 25 Jun 2018 21:02:26 +0200 Subject: [PATCH 2/3] Use es5 syntax in serviceworker --- config-overrides.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config-overrides.js b/config-overrides.js index b1a0e4f8c3..27160f857c 100644 --- a/config-overrides.js +++ b/config-overrides.js @@ -110,9 +110,13 @@ module.exports = function override(config, env) { autoUpdate: true, cacheMaps: [ { - match(url) { - const EXTERNAL_PATHS = ['/api', '/auth']; - if (EXTERNAL_PATHS.some(path => url.pathname.indexOf(path) === 0)) + match: function(url) { + var EXTERNAL_PATHS = ['/api', '/auth']; + if ( + EXTERNAL_PATHS.some(function(path) { + return url.pathname.indexOf(path) === 0; + }) + ) return false; return url; }, From 3ae62f757178da6bc0dfb126ab5faadbcceab616 Mon Sep 17 00:00:00 2001 From: Brian Lovin Date: Mon, 25 Jun 2018 12:33:43 -0700 Subject: [PATCH 3/3] Version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0dbce1b37e..9e93393446 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Spectrum", - "version": "2.4.11", + "version": "2.4.12", "license": "BSD-3-Clause", "devDependencies": { "babel-cli": "^6.24.1",