cashup/frontend/vite.config.ts
jtricerolph 1309ab5719 Fix PWA manifest scope to / per install-architecture doc
Scope was set to the app's own base path, which breaks the installed
PWA out of standalone mode into a regular browser tab on any
same-origin navigation outside that path (e.g. the auth redirect).
scope: "/" keeps navigation inside the installed app's window.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 17:06:42 +00:00

33 lines
997 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
base: '/cashup/',
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'Cash Up',
short_name: 'Cash Up',
start_url: '/cashup/',
scope: '/',
display: 'standalone',
theme_color: '#6b2d8b',
background_color: '#6b2d8b',
icons: [
{ src: '/cashup/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/cashup/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
],
},
workbox: {
navigateFallback: '/cashup/index.html',
// Never let the service worker intercept API calls — auth and data
// must always hit the backend fresh.
navigateFallbackDenylist: [/\/api\//],
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
},
}),
],
})