feat(backend): 添加流程模型与服务支持 feat(frontend): 实现流程编辑器UI与交互 feat(assets): 添加流程节点图标资源 feat(plugins): 实现上下文菜单和运行时插件 feat(components): 新增基础节点和侧边栏组件 feat(routes): 添加流程相关路由配置 feat(models): 创建流程和运行日志数据模型 feat(services): 实现流程服务层逻辑 feat(migration): 添加流程相关数据库迁移 feat(config): 更新前端配置支持流程编辑器 feat(utils): 增强axios错误处理和工具函数
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import { defineConfig, loadEnv } from 'vite'
|
||
import react from '@vitejs/plugin-react'
|
||
|
||
// 单一配置文件 + 多环境 .env:
|
||
// - .env.development / .env.production / .env.staging 中配置变量
|
||
// - 通过 loadEnv 读取并应用到开发服务器与代理
|
||
export default defineConfig(({ mode }) => {
|
||
const env = loadEnv(mode, '.', '')
|
||
const port = Number(env.VITE_PORT || 5173)
|
||
const open = String(env.VITE_OPEN ?? 'true').toLowerCase() === 'true' || env.VITE_OPEN === '1'
|
||
const proxyTarget = env.VITE_ADMIN_PROXY_PATH || 'http://127.0.0.1:8080'
|
||
|
||
return {
|
||
plugins: [
|
||
react({
|
||
babel: {
|
||
plugins: [
|
||
['@babel/plugin-proposal-decorators', { legacy: true }],
|
||
['babel-plugin-transform-typescript-metadata'],
|
||
['@babel/plugin-proposal-class-properties', { loose: true }],
|
||
['@babel/plugin-proposal-private-methods', { loose: true }],
|
||
['@babel/plugin-proposal-private-property-in-object', { loose: true }]
|
||
]
|
||
}
|
||
})
|
||
],
|
||
server: {
|
||
port,
|
||
open,
|
||
proxy: {
|
||
'/api': {
|
||
target: proxyTarget,
|
||
changeOrigin: true
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}) |