diff options
author | Jakob Stendahl <jakobste@uio.no> | 2020-10-14 13:19:00 +0200 |
---|---|---|
committer | Jakob Stendahl <jakobste@uio.no> | 2020-10-14 13:19:00 +0200 |
commit | 606c645dd9a883c4e3c0a64cb92d56a1445d8341 (patch) | |
tree | 049c2df23155539aa5c5428bbb85539d239e44f6 /src/service-worker.ts | |
parent | 24757056f13ea75f957850b2669bfd8e81ea0f54 (diff) | |
download | Aurora-data-606c645dd9a883c4e3c0a64cb92d56a1445d8341.tar.gz Aurora-data-606c645dd9a883c4e3c0a64cb92d56a1445d8341.zip |
Fix gh-pages path problem with service-worker
Diffstat (limited to 'src/service-worker.ts')
-rw-r--r-- | src/service-worker.ts | 6 |
1 files changed, 5 insertions, 1 deletions
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', <EventType extends ExtendableEvent>(event: EventType) => { |