fix(pwa): Disable Service Worker to resolve mobile lag issues
This commit is contained in:
parent
1939d2d777
commit
c6769cb884
1 changed files with 7 additions and 0 deletions
|
|
@ -14,6 +14,8 @@ export default defineConfig(({ mode }) => {
|
||||||
react(),
|
react(),
|
||||||
VitePWA({
|
VitePWA({
|
||||||
registerType: 'autoUpdate',
|
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'],
|
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'masked-icon.svg'],
|
||||||
manifest: {
|
manifest: {
|
||||||
name: 'FoodSnap.ai',
|
name: 'FoodSnap.ai',
|
||||||
|
|
@ -41,6 +43,11 @@ export default defineConfig(({ mode }) => {
|
||||||
purpose: 'any maskable'
|
purpose: 'any maskable'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
workbox: {
|
||||||
|
cleanupOutdatedCaches: true,
|
||||||
|
skipWaiting: true,
|
||||||
|
clientsClaim: true,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue