forecasting/frontend/vite.config.ts
jtricerolph 1ee3f7919f Make forecasting installable as a PWA
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-11 11:27:00 +00:00

32 lines
971 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: 'Forecast',
start_url: '/forecasting/',
scope: '/forecasting/',
display: 'standalone',
theme_color: '#0f1f35',
background_color: '#0f1f35',
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}'],
maximumFileSizeToCacheInBytes: 8 * 1024 * 1024,
},
}),
],
})