33 lines
765 B
TypeScript
33 lines
765 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react-swc'
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
import AntdResolve from 'unplugin-auto-import-antd'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
AutoImport({
|
|
resolvers: [AntdResolve()]
|
|
})
|
|
],
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:5050',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: process.env.VITE_NODE_ENV === 'development',
|
|
minify: process.env.VITE_NODE_ENV === 'production',
|
|
},
|
|
optimizeDeps: {
|
|
exclude: ['@ant-design/v5-patch-for-react-19'],
|
|
},
|
|
})
|