Switch PWA service worker to autoUpdate to avoid stale bundles after deploy

VitePWA's registerType: 'prompt' kept the new service worker waiting
indefinitely because no update-prompt UX was wired. Returning visitors
kept receiving the old precached app shell and hashed chunks. 'autoUpdate'
uses skipWaiting + clientsClaim so a deploy takes over on the next
navigation.

Refs: #86
This commit is contained in:
amoussa1229 2026-07-01 00:17:28 +00:00
parent fb9f1901d4
commit 5cf60b361f

View file

@ -173,7 +173,7 @@ const config = defineConfig({
tanstackStart({ spa: { enabled: true } }),
VitePWA({
injectRegister: false,
registerType: "prompt",
registerType: "autoUpdate",
outDir: ".output/public",
devOptions: {
enabled: true,