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.
31 lines
880 B
TypeScript
31 lines
880 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
|
|
export default defineConfig({
|
|
base: '/plant/',
|
|
plugins: [
|
|
react(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
manifest: {
|
|
name: 'Plant Room',
|
|
short_name: 'Plant Room',
|
|
start_url: '/plant/',
|
|
scope: '/plant/',
|
|
display: 'standalone',
|
|
theme_color: '#0e7490',
|
|
background_color: '#0e7490',
|
|
icons: [
|
|
{ src: '/plant/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
|
|
{ src: '/plant/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
|
|
],
|
|
},
|
|
workbox: {
|
|
navigateFallback: '/plant/index.html',
|
|
navigateFallbackDenylist: [/\/api\//],
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
|
|
},
|
|
}),
|
|
],
|
|
})
|