Fix service worker caching index.html causing blank page

This commit is contained in:
Mo Tarbin 2024-07-29 01:00:39 -04:00
parent b7ee1c0f26
commit 0df5162981

View file

@ -14,7 +14,10 @@ export default defineConfig({
'safari-pinned-tab.svg', 'safari-pinned-tab.svg',
'mstile-150x150.png', 'mstile-150x150.png',
], ],
injectManifest: true, injectManifest: {
globPatterns: ['**/*.{js,css,html,png,svg}'],
globIgnores: ['index.html'],
},
manifest: { manifest: {
name: 'Donetick: Simplify Tasks & Chores, Together.', name: 'Donetick: Simplify Tasks & Chores, Together.',
short_name: 'Donetick', short_name: 'Donetick',
@ -55,6 +58,10 @@ export default defineConfig({
background_color: '#ffffff', background_color: '#ffffff',
display: 'standalone', display: 'standalone',
}, },
workbox: {
skipWaiting: true, // Force the waiting service worker to become the active service worker
clientsClaim: true, // Take control of uncontrolled clients as soon as the service worker becomes active
},
}), }),
], ],