Make forecasting installable as a PWA

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-11 11:27:00 +00:00
parent 084555efdb
commit 1ee3f7919f
7 changed files with 4055 additions and 15 deletions

View file

@ -1,7 +1,32 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
plugins: [react()],
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,
},
}),
],
})