Skip to content

Commit 2abcdd6

Browse files
authored
Merge pull request #138 from neviaumi/GH-137_deal-with-service-worker
GH-137: Update service worker configuration for improved caching
2 parents 837c60b + 728c9c5 commit 2abcdd6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

systems/web/astro.config.mjs

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,13 @@ export default defineConfig({
3232
start_url: 'https://neviaumi.github.io/portfolio/',
3333
theme_color: '#ffffff',
3434
workbox: {
35+
globPatterns: ['**/*.{js,css,html,json,pdf,png,jpg,svg}'], // Precaches all relevant files
3536
navigateFallback: '/portfolio/404',
36-
navigateFallbackAllowlist: [
37-
/^\/portfolio\/api\/.*$/,
38-
/^\/portfolio\/.*\.json$/,
39-
], // Allow API routes and JSON paths
4037
},
4138
},
39+
// No service worker in development
4240
registerType: process.env.NODE_ENV !== 'production' ? null : 'autoUpdate',
41+
selfDestroying: process.env.NODE_ENV !== 'production',
4342
}),
4443
],
4544
site: 'https://neviaumi.github.io/',

0 commit comments

Comments
 (0)