28 lines
951 B
TypeScript
28 lines
951 B
TypeScript
import vue from '@vitejs/plugin-vue'
|
|
import { defineConfig } from 'vite'
|
|
import { resolve } from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
base: '/static/',
|
|
resolve: {
|
|
alias: { '@': resolve(__dirname, 'src') },
|
|
},
|
|
server: {
|
|
proxy: {
|
|
// 开发时:前端同源请求(无 /api 前缀)代理到 FastAPI
|
|
'/chat': { target: 'http://localhost:8000', changeOrigin: true },
|
|
'/runs': { target: 'http://localhost:8000', changeOrigin: true },
|
|
'/review': { target: 'http://localhost:8000', changeOrigin: true },
|
|
'/api/metrics':{ target: 'http://localhost:8000', changeOrigin: true },
|
|
'/config': { target: 'http://localhost:8000', changeOrigin: true },
|
|
'/health': { target: 'http://localhost:8000', changeOrigin: true },
|
|
'/traces':{ target: 'http://localhost:8000', changeOrigin: true },
|
|
},
|
|
},
|
|
build: {
|
|
outDir: '../gateway/static',
|
|
emptyOutDir: true,
|
|
},
|
|
})
|