import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import { VitePWA } from 'vite-plugin-pwa' export default defineConfig({ base: '/weather/', plugins: [ react(), VitePWA({ strategies: 'injectManifest', srcDir: 'src', filename: 'sw.js', registerType: 'autoUpdate', manifest: { name: 'Weather', short_name: 'Weather', // Root, not /admin — installing this PWA is for the reception kiosk screen, // so "open the app" should land straight on the public display. start_url: '/weather/', scope: '/weather/', display: 'standalone', theme_color: '#0ea5e9', background_color: '#0ea5e9', icons: [ { src: '/weather/icons/icon-192.png', sizes: '192x192', type: 'image/png' }, { src: '/weather/icons/icon-512.png', sizes: '512x512', type: 'image/png' }, ], }, injectManifest: { globPatterns: ['**/*.{js,css,html,ico,png,svg}'], }, }), ], })