import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; import { VitePWA } from 'vite-plugin-pwa'; import basicSsl from '@vitejs/plugin-basic-ssl'; export default defineConfig({ plugins: [ sveltekit(), basicSsl(), VitePWA({ registerType: 'autoUpdate', includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'mask-icon.svg'], manifest: { name: 'Spiceflow', short_name: 'Spiceflow', description: 'AI Session Orchestration - The spice must flow', theme_color: '#f97316', background_color: '#18181b', display: 'standalone', orientation: 'portrait', scope: '/', start_url: '/', icons: [ { src: 'pwa-192x192.png', sizes: '192x192', type: 'image/png' }, { src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' }, { src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' } ] }, workbox: { globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'], runtimeCaching: [ { urlPattern: /^https:\/\/.*\/api\/.*/i, handler: 'NetworkFirst', options: { cacheName: 'api-cache', expiration: { maxEntries: 100, maxAgeSeconds: 60 * 5 // 5 minutes } } } ] }, devOptions: { enabled: true } }) ], server: { host: '0.0.0.0', proxy: { '/api': { target: `http://localhost:${process.env.VITE_BACKEND_PORT || 3000}`, changeOrigin: true, ws: true } } } });