From fa90f8890664858c791e430540be60bb6e6fc642 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Thu, 23 Nov 2023 13:52:45 +0100 Subject: [PATCH 1/2] fix: service worker exceptions --- src/service-worker.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/service-worker.ts b/src/service-worker.ts index aeb0ace2e0..06fe0fba06 100644 --- a/src/service-worker.ts +++ b/src/service-worker.ts @@ -8,11 +8,16 @@ import { build, files, version } from '$service-worker'; // Create a unique cache name for this deployment const CACHE = `cache-${version}`; +const EXCEPTIONS = [ + '/images/blog', + '/assets.zip' +] + const ASSETS = [ ...build, // the app itself ...files // everything in `static` -]; - +].filter(file => !EXCEPTIONS.some(e => file.startsWith(e))); +console.log(ASSETS); const sw = self as unknown as ServiceWorkerGlobalScope; sw.addEventListener('install', (event) => { From ea7b6114c907b11217d5feea6e1b7735af062658 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Thu, 23 Nov 2023 13:53:35 +0100 Subject: [PATCH 2/2] chore: remove leftover --- src/service-worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service-worker.ts b/src/service-worker.ts index 06fe0fba06..a4e40b6b88 100644 --- a/src/service-worker.ts +++ b/src/service-worker.ts @@ -17,7 +17,7 @@ const ASSETS = [ ...build, // the app itself ...files // everything in `static` ].filter(file => !EXCEPTIONS.some(e => file.startsWith(e))); -console.log(ASSETS); + const sw = self as unknown as ServiceWorkerGlobalScope; sw.addEventListener('install', (event) => {