maintenance/frontend/vite.config.ts
jtricerolph ffeff92406 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:03 +00:00

32 lines
902 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
base: '/maintenance/',
plugins: [
react(),
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.js',
registerType: 'autoUpdate',
manifest: {
name: 'Maintenance',
short_name: 'Maint.',
start_url: '/maintenance/',
scope: '/maintenance/',
display: 'standalone',
theme_color: '#b45309',
background_color: '#b45309',
icons: [
{ src: '/maintenance/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/maintenance/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
],
},
injectManifest: {
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
},
}),
],
})