import { defineConfig } from 'vite' import { svelte } from '@sveltejs/vite-plugin-svelte' import { VitePWA } from 'vite-plugin-pwa' import { fileURLToPath, URL } from 'node:url' export default defineConfig({ plugins: [ svelte(), VitePWA({ registerType: 'autoUpdate', manifest: { name: 'UnitPrint', short_name: 'UnitPrint', start_url: '/', display: 'standalone', background_color: '#ffffff', theme_color: '#ff3e00', icons: [ { src: '/icon-192x192.png', sizes: '192x192', type: 'image/png' } ] } }) ], resolve: { alias: { $lib: fileURLToPath(new URL('./src/lib', import.meta.url)) } }, server: { proxy: { '/api': { target: 'http://localhost:3000', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') } } } })