初始化2

This commit is contained in:
SunYF
2026-08-28 15:06:01 +08:00
parent b34325a16f
commit a9c3fbeb41
537 changed files with 176215 additions and 17 deletions
+25
View File
@@ -0,0 +1,25 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { fileURLToPath, URL } from 'node:url';
// 让 import 路径与项目文件夹名(bj_power_dashboard)对齐
const dashboardAlias = '@bj_power_dashboard';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
[dashboardAlias]: fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
port: 5173,
proxy: {
// 开发环境代理到 MES,避免跨域
'/api': {
target: process.env.VITE_MES_BASE_URL || 'http://127.0.0.1:8000',
changeOrigin: true,
},
},
},
});