import react from '@vitejs/plugin-react'; import { defineConfig } from 'vitest/config'; import { VitePWA } from 'vite-plugin-pwa'; export default defineConfig({ plugins: [ react(), VitePWA({ registerType: 'autoUpdate', manifest: { name: 'NexaPantry', short_name: 'NexaPantry', description: 'Self-hosted pantry management for homes and shared households.', theme_color: '#0f766e', background_color: '#f8fafc', display: 'standalone', scope: '/', start_url: '/', icons: [ { src: '/icons/icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any maskable' } ] }, workbox: { navigateFallback: '/index.html', globPatterns: ['**/*.{js,css,html,svg,png,woff2}'], runtimeCaching: [ { urlPattern: ({ url }) => url.pathname.startsWith('/api/'), handler: 'NetworkFirst', options: { cacheName: 'nexapantry-api', networkTimeoutSeconds: 3 } } ] } }) ], server: { proxy: { '/api': 'http://127.0.0.1:8000' } }, test: { environment: 'jsdom', globals: true, setupFiles: './src/test-setup.ts' } });