Fixed preview generation, including service worker

This commit is contained in:
Alejandro Celaya
2022-12-25 09:19:26 +01:00
parent 822fe3db9e
commit 3e0abe329f
2 changed files with 2 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ import { ExpirationPlugin } from 'workbox-expiration';
import { precacheAndRoute, createHandlerBoundToURL } from 'workbox-precaching';
import { registerRoute } from 'workbox-routing';
import { StaleWhileRevalidate } from 'workbox-strategies';
import pack from '../package.json';
declare const self: ServiceWorkerGlobalScope;
@@ -49,7 +50,7 @@ registerRoute(
// Return true to signal that we want to use the handler.
return true;
},
createHandlerBoundToURL('/index.html') // TODO Add prefix
createHandlerBoundToURL(`${pack.homepage}/index.html`)
);
// An example runtime caching route for requests that aren't handled by the