Every installed PWA claimed scope "/", so Android link-capturing routed navigation for any app on the shared origin into whichever PWA had it.
33 lines
1,004 B
TypeScript
33 lines
1,004 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: '/cashup/',
|
|
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}'],
|
|
},
|
|
}),
|
|
],
|
|
})
|