import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' export default defineConfig({ plugins: [react()], server: { port: 5173, host: process.env.TAURI_DEV_HOST || 'localhost', proxy: { '/api': { target: process.env.TAURI_DEV_HOST ? 'https://family-budget.duckdns.org' : 'http://localhost:8080', changeOrigin: true, configure: (proxy) => { if (process.env.TAURI_DEV_HOST) { proxy.on('proxyRes', (proxyRes) => { const cookies = proxyRes.headers['set-cookie']; if (cookies) { proxyRes.headers['set-cookie'] = cookies.map(cookie => cookie .replace(/;\s*Secure/gi, '') .replace(/;\s*Domain=[^;]*/gi, '') ); } }); } }, } } } })