Replies: 2 comments 5 replies
-
You cannot use custom sw when using generateSW strategy. That strategy will generate the sw for you. |
Beta Was this translation helpful? Give feedback.
1 reply
-
You can check the cjs scripts using workbox-build node module: the pwa plugin will do that work for you (check package.json scripts) https://github.com/vite-pwa/workbox-window-es/tree/main/examples/vue-router/sw |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm new to PWA technology, what I know is that there are 2 strategies in PWA, namely generateSW and injectManifest.
From what I read, if you want to create a custom service worker, you should use injectManifest. what about using generateSW?
I tried to use the importScripts provided by Vite PWA in the config file, but in the official documentation the use of importScript is not recommended. Then how do I create a custom service worker in the generateSW strategy without using the importScripts feature in the config file?
until now I still use importScript to add custom service workers which must be placed into the public folder
Beta Was this translation helpful? Give feedback.
All reactions