From 606c645dd9a883c4e3c0a64cb92d56a1445d8341 Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Wed, 14 Oct 2020 13:19:00 +0200 Subject: Fix gh-pages path problem with service-worker --- src/service-worker.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/service-worker.ts b/src/service-worker.ts index 1441676..b721b18 100644 --- a/src/service-worker.ts +++ b/src/service-worker.ts @@ -2,9 +2,13 @@ import { timestamp, files, shell, routes } from '@sapper/service-worker'; const ASSETS = `cache${timestamp}`; + +const nonRootFiles = files.map(f => "/Aurora-data" + f); +const nonRootShell = shell.map(f => "/Aurora-data" + f); + // `shell` is an array of all the files generated by the bundler, // `files` is an array of everything in the `static` directory -const to_cache = (shell as string[]).concat(files as string[]); +const to_cache = nonRootShell.concat(nonRootFiles); const cached = new Set(to_cache); self.addEventListener('install', (event: EventType) => { -- cgit v1.2.3