Files
aiagent/frontend/vite.config.ts

26 lines
661 B
TypeScript
Raw Normal View History

2026-01-19 00:09:36 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
port: 3001,
2026-01-19 00:09:36 +08:00
proxy: {
'/api': {
// 8037 是后端实际端口;可通过环境变量 AIAGENT_API_PROXY 覆盖
// PowerShell: $env:AIAGENT_API_PROXY='http://127.0.0.1:8037'; pnpm dev
target: process.env.AIAGENT_API_PROXY || 'http://127.0.0.1:8038',
changeOrigin: true,
ws: true
2026-01-19 00:09:36 +08:00
}
}
}
})