Exclude swagger for service worker fallback

This commit is contained in:
Mihaly Hobor
2026-01-22 23:17:02 +01:00
parent 59289a2f40
commit 2e92acbfd5

View File

@@ -62,6 +62,12 @@ export default defineConfig({
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
maximumFileSizeToCacheInBytes: 6000000, // 6MB
//Exclude API and Swagger routes from service worker navigation fallback
navigateFallback: '/index.html',
navigateFallbackDenylist: [
/^\/api\//, // Exclude all API routes
/^\/swagger/, // Exclude all Swagger routes
]
},
}),
],