Add PWA manifest support and icons

App had no manifest, no service worker, and no icons — not
installable as a PWA at all.
This commit is contained in:
jtricerolph 2026-07-29 17:28:47 +00:00
parent 70908807f6
commit 6ed4601f11
4 changed files with 27 additions and 2 deletions

View file

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