import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' import path from 'path' // Backend port - can be overridden via VITE_API_PORT env var const apiPort = process.env.VITE_API_PORT || '8888' // https://vite.dev/config/ export default defineConfig({ plugins: [react(), tailwindcss()], resolve: { alias: { '@': path.resolve(__dirname, './src'), }, }, server: { proxy: { '/api': { target: `http://127.0.0.1:${apiPort}`, changeOrigin: true, }, '/ws': { target: `ws://127.0.0.1:${apiPort}`, ws: true, }, }, }, })