From 2e92acbfd59c8e48055da247529868a45c5e21fc Mon Sep 17 00:00:00 2001 From: Mihaly Hobor Date: Thu, 22 Jan 2026 23:17:02 +0100 Subject: [PATCH] Exclude swagger for service worker fallback --- vite.config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vite.config.js b/vite.config.js index 6d6044b..07f2602 100644 --- a/vite.config.js +++ b/vite.config.js @@ -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 + ] }, }), ],