Files
aiops/frontend/vite.config.ts
T
Logan.Li 992e9b2ecc fix(frontend): 修复 SPA 深链直访白屏(vite base 改为绝对路径)
- base: './' → '/',避免 /audit/terminal 等路径下 assets 404
- 审计页改为独立路由组件,支持 URL 直链
2026-06-26 11:02:27 +08:00

40 lines
938 B
TypeScript

import path from "path"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"
import { inspectAttr } from 'kimi-plugin-inspect-react'
// https://vite.dev/config/
export default defineConfig({
// 必须用绝对路径,否则 /audit/terminal 等深链会解析成 /audit/assets/... 导致白屏 // Logan.Li
base: '/',
plugins: [inspectAttr(), react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
port: 5173,
host: true,
proxy: {
"/api": {
target: "http://localhost:8080",
changeOrigin: true,
},
"/ws": {
target: "http://localhost:8080",
ws: true,
changeOrigin: true,
},
"/health": {
target: "http://localhost:8080",
changeOrigin: true,
},
"/version": {
target: "http://localhost:8080",
changeOrigin: true,
},
},
},
})