Wire up vite-plugin-pwa so Docker builds generate the web manifest and service worker (was missing, causing installs to show portal icon). Adds UpdateBanner with version-based polling via health endpoint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
913 B
TypeScript
31 lines
913 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({
|
|
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' },
|
|
],
|
|
},
|
|
workbox: {
|
|
navigateFallback: '/maintenance/index.html',
|
|
navigateFallbackDenylist: [/\/api\//],
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
|
|
},
|
|
}),
|
|
],
|
|
})
|