-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
injectManifest in Development #41
Comments
@udos86 You're using static imports, you need to add If you use Vanilla JS ( |
you must also disable kit sw registration on kit config file: https://github.com/vite-pwa/sveltekit/blob/main/examples/sveltekit-ts/svelte.config.js#L15 (I need to update docs, the configuration entry should be |
We're trying to expose kit configuration (on kit repo), and so ppl won't need to duplicate configuration between kit and vite, pwa integration will use it to configure a lot of stuff properly (we won't be able to modify kit configuration, some options must be configured, for example disabling kit sw registration). |
Thank you very much for your kind and quick response and clearing everything up! 👍 |
First of all I'd like to thank you very much for your effort on bringin Workbox support to Sveltekit ❤️
I've been playing around with
@vite-pwa/sveltekit
the last couple of days and it's a great addition to the framework.From what I can read in the docs, Vite PWA basically supports
injectManifest
strategy in development.However in SvelteKit,
self.__WB_MANIFEST
is not replaced when running in development vianpm run dev
. Therefore an error is thrown:Is this the expected behaviour or a current limitation of SvelteKit's service worker build?
Also I noticed, that the service worker is always running in development regardless of wether
enabled
istrue
orfalse
indevOptions
.As soon as running in preview via
npm run preview
everything works perfectly fine.src/service-worker.ts
:vite.config.js
:The text was updated successfully, but these errors were encountered: