diff --git a/src/serviceWorkerLoader.ts b/src/serviceWorkerLoader.ts index 1beef1d..c10f3dc 100644 --- a/src/serviceWorkerLoader.ts +++ b/src/serviceWorkerLoader.ts @@ -67,7 +67,9 @@ export function register(config?: Config) { function registerValidSW(swUrl: string, config?: Config) { navigator.serviceWorker - .register(swUrl) + .register(swUrl, { + scope: window.location.pathname + }) .then((registration) => { registration.onupdatefound = () => { const installingWorker = registration.installing;