mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-06-25 16:04:02 +08:00
- 依赖引入:新增 reactflow + dagre 用于执行计划 DAG 自动布局 - 构建配置:vite manualChunks 拆分 reactflow/dagre/recharts 独立 chunk,便于按需加载 - 类型镜像:utils/explainTypes.ts 镜像后端 ExplainResult/Node/Stats/IndexSuggestion,含颜色与格式化 helper - 图渲染:ExplainGraph 自定义节点按 opType 着色 + 警告 flag 边框高亮 + dagre TB 布局 - 侧栏组件:ExplainSidebar 含统计条、节点详情、索引建议按 severity 排序 - 主容器:ExplainWorkbench 含 Modal + 执行计划/原文双 tab,调用 DiagnoseQuery 端到端联通
45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { defineConfig } from 'vite'
|
||
import react from '@vitejs/plugin-react'
|
||
|
||
// https://vitejs.dev/config/
|
||
export default defineConfig({
|
||
plugins: [react()],
|
||
optimizeDeps: {
|
||
// Pre-bundle startup locale modules before Wails starts proxying the WebView.
|
||
include: [
|
||
'antd/locale/de_DE',
|
||
'antd/locale/en_US',
|
||
'antd/locale/ja_JP',
|
||
'antd/locale/ru_RU',
|
||
'antd/locale/zh_CN',
|
||
'antd/locale/zh_TW',
|
||
'dayjs/locale/de',
|
||
'dayjs/locale/ja',
|
||
'dayjs/locale/ru',
|
||
'dayjs/locale/zh-cn',
|
||
'dayjs/locale/zh-tw',
|
||
],
|
||
},
|
||
server: {
|
||
host: '127.0.0.1',
|
||
port: 5173,
|
||
strictPort: true,
|
||
},
|
||
build: {
|
||
outDir: 'dist', // Standard Wails output directory
|
||
emptyOutDir: true,
|
||
rollupOptions: {
|
||
output: {
|
||
// 拆分大体积三方依赖到独立 chunk,避免主 bundle 过大
|
||
// reactflow + dagre 约 130KB gzipped,单独成 chunk 可按需加载
|
||
// recharts 用于诊断面板统计条,与执行计划图无强依赖,单独 chunk
|
||
manualChunks: {
|
||
reactflow: ['reactflow'],
|
||
dagre: ['dagre'],
|
||
charts: ['recharts'],
|
||
},
|
||
},
|
||
},
|
||
}
|
||
})
|