forecasting/frontend/vite.config.ts
jtricerolph b9fdd97330 Add PWA manifest support
Icons already existed in public/icons/ but nothing wired them up —
no manifest, no service worker, not installable.
2026-07-29 17:28:35 +00:00

31 lines
918 B
TypeScript

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