web: keep the PWA's SPA fallback away from the gateway's /api/ pages

With UI and gateway on one origin, the service worker answered a
navigation to /api/store/admin with index.html, so the moderation page
opened the client instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
MoepchiandClaude Opus 5.5 committed 2026-09-27 20:12:02 +00:00
1 parent ddc7ce5dec
commit a9f0586b88
1 file changed
+5
+5
View File
@@ -95,6 +95,11 @@ export default defineConfig({
// ignores non-GET and non-http(s) requests (ws:// isn't touched), so
// no extra runtimeCaching exclusions are needed here.
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
// The SPA fallback answers every navigation with index.html — except
// the gateway's own pages under /api/ (e.g. /api/store/admin), which
// would otherwise open the client instead when UI and gateway share
// an origin.
navigateFallbackDenylist: [/^\/api\//],
},
}),
],