Files
EasyFlow/easyflow-ui-admin/app/vite.config.mts
陈子默 a75f7baf1b fix: 统一管理端开发与部署路由契约
- 开发与生产统一使用 /flow/ 基路径和 Hash 路由

- 自动规范化本地根路径入口并补充契约测试
2026-07-24 19:00:47 +08:00

59 lines
1.6 KiB
TypeScript

import { defineConfig } from '@easyflow/vite-config';
import ElementPlus from 'unplugin-element-plus/vite';
import { createBasePathRedirectPlugin } from './vite-base-path-redirect';
export default defineConfig(async () => {
return {
application: {},
vite: {
resolve: {
alias: {
// @vueuse/motion expects tslib default export during dev pre-bundling
// and breaks when Vite resolves to ESM-only modules/index.js.
tslib: 'tslib/tslib.js',
},
},
plugins: [
createBasePathRedirectPlugin(),
ElementPlus({
format: 'esm',
}),
],
server: {
proxy: {
'/flow/api': {
changeOrigin: true,
headers: {
'X-Forwarded-Prefix': '/flow',
},
rewrite: (path) => path.replace(/^\/flow/, ''),
target: 'http://127.0.0.1:8111',
ws: true,
xfwd: true,
},
'/flow/public-api': {
changeOrigin: true,
headers: {
'X-Forwarded-Prefix': '/flow',
},
rewrite: (path) => path.replace(/^\/flow/, ''),
target: 'http://127.0.0.1:8111',
xfwd: true,
},
'/flow/userCenter': {
changeOrigin: true,
headers: {
'X-Forwarded-Prefix': '/flow',
},
rewrite: (path) => path.replace(/^\/flow/, ''),
target: 'http://127.0.0.1:8111',
xfwd: true,
},
},
},
},
};
});