aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-29 01:00:39 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-29 12:00:39 -0400
commit0df5162981aa6f966bf1961d2ce495e6840ffca2 (patch)
tree9f79fa422e407baf17e72b28af4b34f35864d584
parentb7ee1c0f26e4fa4a7f6f623583461f5a9278fae3 (diff)
downloaddonetick-frontend-0df5162981aa6f966bf1961d2ce495e6840ffca2.tar.gz
donetick-frontend-0df5162981aa6f966bf1961d2ce495e6840ffca2.tar.bz2
donetick-frontend-0df5162981aa6f966bf1961d2ce495e6840ffca2.zip
Fix service worker caching index.html causing blank page
-rw-r--r--vite.config.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/vite.config.js b/vite.config.js
index 5af4b6f..f8e9fde 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -14,7 +14,10 @@ export default defineConfig({
'safari-pinned-tab.svg',
'mstile-150x150.png',
],
- injectManifest: true,
+ injectManifest: {
+ globPatterns: ['**/*.{js,css,html,png,svg}'],
+ globIgnores: ['index.html'],
+ },
manifest: {
name: 'Donetick: Simplify Tasks & Chores, Together.',
short_name: 'Donetick',
@@ -55,6 +58,10 @@ export default defineConfig({
background_color: '#ffffff',
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
+ },
}),
],