Add PWA manifest support and icons

App had no manifest, no service worker, and no icons — not
installable as a PWA at all despite having PWA meta tags in index.html.
This commit is contained in:
jtricerolph 2026-07-29 17:28:39 +00:00
parent 0929285651
commit 7f5891d029
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: '/hvac/',
plugins: [react()],
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'HVAC',
short_name: 'HVAC',
start_url: '/hvac/',
scope: '/hvac/',
display: 'standalone',
theme_color: '#c1440e',
background_color: '#c1440e',
icons: [
{ src: '/hvac/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/hvac/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
],
},
workbox: {
navigateFallback: '/hvac/index.html',
navigateFallbackDenylist: [/\/api\//],
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
},
}),
],
})