Files
SPDM/vite.config.ts

93 lines
3.6 KiB
TypeScript
Raw Normal View History

2025-10-30 19:30:06 +08:00
import { fileURLToPath, URL } from 'node:url';
import { defineConfig, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
base: '/spdm/',
plugins: [
vue(),
vueJsx(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
host: '0.0.0.0',
port: 3001,
cors: true,
proxy: {
'/api': {
target: env.VITE_API_HTTP_URL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
2025-11-04 10:49:32 +08:00
'/wsApi': {
target: env.VITE_API_WS_URL,
changeOrigin: true,
2025-11-04 10:56:28 +08:00
rewrite: (path) => path.replace(/^\/wsApi/, ''),
ws: true,
},
2025-10-30 19:30:06 +08:00
'/local7101': {
2025-11-05 09:53:35 +08:00
// target: 'http://192.168.65.199:7101', // 李东洋
2025-11-11 20:29:34 +08:00
// target: 'http://192.168.65.75:7100/simulation/project', // 朱欣茹
target: 'http://192.168.65.161/api/simulation/project', // 开发环境
2025-10-30 19:30:06 +08:00
// target: 'http://192.168.65.161', // 开发环境
// target: 'http://192.168.65.73:7100', // 开发环境
// target: 'http://192.168.65.53:8080', // 戴琼瑶本地
// target: 'http://192.168.65.53:8080', // 顾龙成本地
changeOrigin: true,
rewrite: (path) => path.replace(/^\/local7101/, ''),
},
'/local7102': { // taskPool工况库模块
2025-11-05 09:53:35 +08:00
// target: 'http://192.168.65.199:7102', // 李东洋
target: 'http://192.168.65.161:80/api/simulation/task', // 开发环境
// target: 'http://192.168.65.75:7100/simulation/task', // 朱欣茹
2025-10-30 19:30:06 +08:00
// target: 'http://192.168.65.161', // 开发环境
// target: 'http://192.168.65.73:7100', // 开发环境
// target: 'http://192.168.65.53:8080/simulation', // 戴琼瑶本地
// target: 'http://192.168.65.53:8080', // 顾龙成本地
changeOrigin: true,
rewrite: (path) => path.replace(/^\/local7102/, ''),
},
'/local7103': { // system系统模块
2025-11-05 09:53:35 +08:00
// target: 'http://192.168.65.199:7103', // 李东洋
2025-11-11 20:29:34 +08:00
target: 'http://192.168.65.161:80/api/simulation/system', // 开发环境
// target: 'http://192.168.65.75:7100/simulation/system', // 朱欣茹
2025-10-30 19:30:06 +08:00
changeOrigin: true,
// rewrite: (path) => path.replace(/^\/local7103/, ''),
rewrite: (path) => {
return path.replace(/^\/local7103/, '');
},
},
'/local7104': { // data文件模块
2025-11-05 09:53:35 +08:00
// target: 'http://192.168.65.199:7104', // 李东洋
target: 'http://192.168.65.161:80/api/simulation/data', // 开发环境
2025-10-30 19:30:06 +08:00
// target: 'http://192.168.65.161', // 开发环境
changeOrigin: true,
rewrite: (path) => path.replace(/^\/local7104/, ''),
},
2025-12-01 11:37:43 +08:00
'/local7105': { // pds模块
target: 'http://192.168.65.161:80/api/simulation/pbs', // 开发环境
changeOrigin: true,
rewrite: (path) => path.replace(/^\/local7105/, ''),
},
'/local7107': { // data文件模块
// target: 'http://192.168.65.199:7104', // 李东洋
2025-11-24 15:12:35 +08:00
target: 'http://192.168.65.161:80/api/simulation/capability', // 开发环境
2025-11-11 20:29:34 +08:00
// target: 'http://192.168.65.219:7107', // 戴琼瑶本地
// target: 'http://192.168.65.161', // 开发环境
2025-10-30 19:30:06 +08:00
changeOrigin: true,
rewrite: (path) => path.replace(/^\/local7107/, ''),
2025-10-30 19:30:06 +08:00
},
},
},
};
});