forked from mirror/crumbs-original
fix: use absolute paths for service worker registration
SvelteKit sets Vite's base to './' for client builds, causing the PWA plugin to generate relative SW paths (./sw.js). On sub-routes like /settings or /tag/foo, this resolves to /settings/sw.js which returns HTML, breaking SW registration. Force scope and buildBase to '/'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
fe034f4f98
commit
f8937d287d
@@ -23,6 +23,8 @@ export default defineConfig({
|
||||
]
|
||||
: []),
|
||||
SvelteKitPWA({
|
||||
scope: '/',
|
||||
buildBase: '/',
|
||||
registerType: 'autoUpdate',
|
||||
manifest: {
|
||||
name: 'Crumbs by Bretzel',
|
||||
|
||||
Reference in New Issue
Block a user