rates/frontend/vite.config.ts
jtricerolph 5af0863ab7 Scope PWA manifest to app's own path instead of origin root
Every installed PWA claimed scope "/", so Android link-capturing routed
navigation for any app on the shared origin into whichever PWA had it.
2026-07-29 13:47:12 +00:00

32 lines
933 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
base: '/rates/',
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'Rate Monitor',
short_name: 'Rates',
start_url: '/rates/',
scope: '/rates/',
display: 'standalone',
theme_color: '#7b4f00',
background_color: '#7b4f00',
icons: [
{ src: '/rates/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/rates/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
],
},
workbox: {
navigateFallback: '/rates/index.html',
navigateFallbackDenylist: [/\/api\//],
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
maximumFileSizeToCacheInBytes: 8 * 1024 * 1024,
},
}),
],
})