新项目, antd6, react19

This commit is contained in:
zhengw
2026-01-05 17:06:16 +08:00
commit fcb43c0cbd
84 changed files with 6939 additions and 0 deletions

37
vite.config.ts Normal file
View File

@@ -0,0 +1,37 @@
import path from 'node:path';
import react from '@vitejs/plugin-react-swc';
// import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';
// https://vite.dev/config/
export default defineConfig({
plugins: [
react(), // 打包后生成体积分析报告dist/stats.html
// visualizer({
// // open: true, // 自动打开报告页面
// filename: 'stats.html',
// }),
],
base: './',
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 4050,
host: '0.0.0.0',
proxy: {
'/api': {
target: 'http://192.168.1.138:93',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), // 不可以省略rewrite
},
'/static': {
target: 'http://192.168.1.138:83',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), // 不可以省略rewrite
},
},
},
});