主要变更: - RDP 远程桌面:新增 backend/pkg/rdp(RDP 引擎 + credssp/display/rle/trace)、 backend/controller/rdp*(连接/凭证/文件/会话/实时)、frontend RDP 组件与 API - Windows SMB 文件传输:backend/pkg/winsmb - 云账单同步:backend/pkg/billingsync + billing_sync/aliyun_billing,前端账单详情 - Agent CLI Kubernetes 工具:kubernetes_action/get、pod_execute/logs - 服务器导入助手:server_import_helpers、ImportCredentialSettings - 国际化与组件重构(cloud/deploy/monitor/server/system 等多模块) - 清理编译产物二进制:移除 backend/server、backend/agent/bin/aiops-agent-* - .gitignore:新增 backend/agent/ 与 .cache/(避免 334MB go-build 缓存误入库) Co-Authored-By: Claude <noreply@anthropic.com>
70 lines
2.3 KiB
TypeScript
70 lines
2.3 KiB
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(({ command }) => ({
|
|
// 必须用绝对路径,否则 /audit/terminal 等深链会解析成 /audit/assets/... 导致白屏 // Logan.Li
|
|
base: '/',
|
|
plugins: [
|
|
// 生产构建禁用调试属性注入,减少 JSX 转换和 Rollup 内存峰值 // Logan.Li
|
|
command === 'serve' ? inspectAttr() : undefined,
|
|
react(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
build: {
|
|
sourcemap: false,
|
|
reportCompressedSize: false,
|
|
rollupOptions: {
|
|
output: {
|
|
// 拆分大依赖族,降低 rendering chunks 阶段单 chunk 内存峰值 // Logan.Li
|
|
manualChunks(id) {
|
|
if (!id.includes("node_modules")) return
|
|
if (id.includes("react") || id.includes("react-dom") || id.includes("react-router")) return "vendor-react"
|
|
if (id.includes("@radix-ui") || id.includes("cmdk") || id.includes("vaul")) return "vendor-ui"
|
|
if (id.includes("@tanstack")) return "vendor-query"
|
|
if (id.includes("react-markdown") || id.includes("remark-gfm")) return "vendor-markdown"
|
|
if (id.includes("i18next") || id.includes("react-i18next")) return "vendor-i18n"
|
|
if (id.includes("react-hook-form") || id.includes("zod") || id.includes("@hookform")) return "vendor-form"
|
|
if (id.includes("@codemirror") || id.includes("@uiw/react-codemirror")) return "vendor-codemirror"
|
|
if (id.includes("xterm")) return "vendor-xterm"
|
|
if (id.includes("lucide-react")) return "vendor-icons"
|
|
},
|
|
},
|
|
},
|
|
chunkSizeWarningLimit: 600,
|
|
},
|
|
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,
|
|
},
|
|
"/agent": {
|
|
target: "http://localhost:8080",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
}))
|