后端: - 拆分出 agent_service, runtime_service, trading_service, news_service - Gateway 模块化拆分 (gateway_*.py) - 添加 domains/ 领域层 - 新增 control_client, runtime_client - 更新 start-dev.sh 支持 split 服务模式 前端: - 完善 API 服务层 (newsApi, tradingApi) - 更新 vite.config.js - Explain 组件优化 测试: - 添加多个服务 app 测试 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
106 lines
2.5 KiB
JavaScript
106 lines
2.5 KiB
JavaScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
export default defineConfig({
|
|
server: {
|
|
allowedHosts: ["localhost", "trading.evoagents.cn","www.evoagents.cn"],
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8000',
|
|
changeOrigin: true
|
|
},
|
|
'/ws': {
|
|
target: 'ws://localhost:8765',
|
|
ws: true
|
|
}
|
|
}
|
|
},
|
|
plugins: [react(), tsconfigPaths(),tailwindcss()],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (!id.includes("node_modules")) {
|
|
return;
|
|
}
|
|
|
|
if (
|
|
id.includes("/react/") ||
|
|
id.includes("/react-dom/") ||
|
|
id.includes("/scheduler/")
|
|
) {
|
|
return "react-core";
|
|
}
|
|
|
|
if (
|
|
id.includes("/three/") ||
|
|
id.includes("/@react-three/") ||
|
|
id.includes("/meshline/") ||
|
|
id.includes("/troika-")
|
|
) {
|
|
return "three-stack";
|
|
}
|
|
|
|
if (
|
|
id.includes("/recharts/") ||
|
|
id.includes("/d3-") ||
|
|
id.includes("/victory-")
|
|
) {
|
|
return "charts";
|
|
}
|
|
|
|
if (
|
|
id.includes("/react-markdown/") ||
|
|
id.includes("/remark-gfm/") ||
|
|
id.includes("/remark-") ||
|
|
id.includes("/mdast-") ||
|
|
id.includes("/micromark") ||
|
|
id.includes("/unified/") ||
|
|
id.includes("/hast-") ||
|
|
id.includes("/vfile/")
|
|
) {
|
|
return "markdown";
|
|
}
|
|
|
|
if (
|
|
id.includes("/framer-motion/") ||
|
|
id.includes("/motion-dom/") ||
|
|
id.includes("/motion-utils/")
|
|
) {
|
|
return "motion";
|
|
}
|
|
|
|
if (
|
|
id.includes("/@radix-ui/") ||
|
|
id.includes("/lucide-react/") ||
|
|
id.includes("/class-variance-authority/") ||
|
|
id.includes("/clsx/") ||
|
|
id.includes("/tailwind-merge/")
|
|
) {
|
|
return "ui-kit";
|
|
}
|
|
|
|
if (
|
|
id.includes("/jszip/") ||
|
|
id.includes("/pako/") ||
|
|
id.includes("/fflate/")
|
|
) {
|
|
return "zip-utils";
|
|
}
|
|
|
|
return "vendor";
|
|
}
|
|
}
|
|
}
|
|
},
|
|
test: {
|
|
environment: "jsdom"
|
|
},
|
|
preview: {
|
|
host: "0.0.0.0",
|
|
port: 4173
|
|
},
|
|
});
|