fix(pwa): Disable Service Worker to resolve mobile lag issues

This commit is contained in:
Marcio Bevervanso 2026-02-17 20:50:47 -03:00
parent 1939d2d777
commit c6769cb884

View file

@ -14,6 +14,8 @@ export default defineConfig(({ mode }) => {
react(),
VitePWA({
registerType: 'autoUpdate',
injectRegister: null, // Disable automatic SW injection to fix lag
selfDestroying: true, // Force unregister existing SW
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'masked-icon.svg'],
manifest: {
name: 'FoodSnap.ai',
@ -41,6 +43,11 @@ export default defineConfig(({ mode }) => {
purpose: 'any maskable'
}
]
},
workbox: {
cleanupOutdatedCaches: true,
skipWaiting: true,
clientsClaim: true,
}
})
],