import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' import { VitePWA } from 'vite-plugin-pwa' export default defineConfig({ server: { host: '0.0.0.0', port: 5173, proxy: { '/api': { target: process.env.VITE_API_PROXY || 'http://localhost:8000', changeOrigin: true, }, }, }, plugins: [ react(), tailwindcss(), VitePWA({ registerType: 'autoUpdate', manifest: { name: 'Solar Monitor', short_name: 'Solar', description: 'Live status and output of the Refusol inverters', start_url: '/', display: 'standalone', background_color: '#0d0d0d', theme_color: '#0d0d0d', icons: [ { src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any' }, { src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any' }, { src: '/icons/icon-maskable-512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' }, ], }, workbox: { globPatterns: ['**/*.{js,css,html,ico,png,svg}'], // Live data must never come from the cache navigateFallbackDenylist: [/^\/api/], runtimeCaching: [], }, }), ], })