You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having dual svelte-kit apps, both sharing about 99% of the codebase, but one does not have a service-worker.js
Importance
would make my life easier
Additional Information
I've not yet fully understood how to submit the pull request (my understanding of the svelte-kit internals are limited), but i was able to simply modify ...node_modules/@sveltejs/kit/dist/ssr.js: (i find it here)
find: if (options.service_worker) {
replace with: if (options.service_worker && !!page_config.service_worker) {
#2988 has been merged which adds an option to disable the existing service worker registration, so I think you could now add your own to address this and I'll go ahead and close this. Let me know if there's something that would still be required
Describe the problem
I've got a use case where I'd like to disable the
service-worker.js
on only specific page levels. I want to exclude it on only 2 routes in my app.Describe the proposed solution
Alternatives considered
Having dual svelte-kit apps, both sharing about 99% of the codebase, but one does not have a
service-worker.js
Importance
would make my life easier
Additional Information
I've not yet fully understood how to submit the pull request (my understanding of the svelte-kit internals are limited), but i was able to simply modify
...node_modules/@sveltejs/kit/dist/ssr.js
: (i find it here)find:
if (options.service_worker) {
replace with:
if (options.service_worker && !!page_config.service_worker) {
To enable
And we could just add one more section to the page-config options inside of the docs.
** edit: my proposed solution does not do what I expected it to - I obviously am not understanding the svelte-kit internals enough (yet)
The text was updated successfully, but these errors were encountered: