import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import path from "path"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], resolve: { alias: { "@": path.resolve(__dirname, "./src"), }, }, server: { port: 5173, host: true, // Listen on all addresses allowedHosts: [ ".trycloudflare.com", // Cloudflare Quick Tunnels ".turbo.local", // Custom tunnel domains ".devtunnels.ms", // VS Code Dev Tunnels "localhost", ], proxy: { "/api": { target: "http://localhost:3000", changeOrigin: true, // Don't rewrite - backend expects /api prefix }, "/ws": { target: "http://localhost:3000", ws: true, changeOrigin: true, }, }, }, build: { outDir: "dist", sourcemap: false, rollupOptions: { output: { manualChunks: { "vue-vendor": ["vue", "vue-router", "pinia"], }, }, }, }, });