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>
32 lines
927 B
TypeScript
32 lines
927 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: '/',
|
|
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,
|
|
},
|
|
}),
|
|
],
|
|
})
|