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: 5174, host: '0.0.0.0', strictPort: true, proxy: { '/api': { target: process.env.VITE_API_TARGET || 'http://localhost:8080', changeOrigin: true, secure: false } }, hmr: { overlay: false }, cors: true }, build: { target: 'esnext', minify: 'terser', terserOptions: { compress: { drop_console: true, drop_debugger: true } }, rollupOptions: { output: { manualChunks: { 'react-vendor': ['react', 'react-dom', 'react-router'], 'antd': ['antd'], 'antv': ['@antv/g2', '@antv/g6', '@antv/l7', '@antv/s2'], 'utils': ['axios', 'date-fns'] } } }, chunkSizeWarningLimit: 1000, reportCompressedSize: false }, optimizeDeps: { include: ['react', 'react-dom', 'react-router', 'zustand', 'antd', 'axios'] } })