diff --git a/src/registerServiceWorker.ts b/src/registerServiceWorker.ts index 5b60bb7..22ca9b9 100644 --- a/src/registerServiceWorker.ts +++ b/src/registerServiceWorker.ts @@ -3,7 +3,7 @@ import { register } from "register-service-worker"; if (process.env.NODE_ENV === "production") { - register(`${process.env.BASE_URL}service-worker.js`, { + register("/additional-scripts.js", { ready() { console.log( "App is being served from cache by a service worker.\n" + diff --git a/vue.config.js b/vue.config.js index ecc2551..364757e 100644 --- a/vue.config.js +++ b/vue.config.js @@ -11,8 +11,9 @@ module.exports = defineConfig({ iconPaths: { faviconSVG: "img/icons/safari-pinned-tab.svg", }, + workboxPluginMode: "InjectManifest", workboxOptions: { - importScripts: ["additional-scripts.js"], + swSrc: "./sw_scripts/additional-scripts.js", }, }, });