import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import path from 'path'; export default defineConfig({ plugins: [react()], resolve: { alias: { '@': path.resolve(__dirname, './src'), }, }, server: { port: 3000, proxy: { '/api/wallet': { target: 'http://localhost:3090', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/wallet/, ''), }, '/api/products': { target: 'http://localhost:3091', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/products/, ''), }, '/api/vip': { target: 'http://localhost:3092', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/vip/, ''), }, '/api/investment': { target: 'http://localhost:3093', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/investment/, ''), }, '/api/predictions': { target: 'http://localhost:3094', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/predictions/, ''), }, }, }, build: { outDir: 'dist', sourcemap: true, rollupOptions: { output: { manualChunks: { vendor: ['react', 'react-dom', 'react-router-dom'], query: ['@tanstack/react-query'], state: ['zustand'], }, }, }, }, });