7c6129555b
- 修复 EcommercePage generateEcommerceImage 调用不存在变量导致运行时崩溃 - 修复 DigitalHumanPage/ImageWorkbenchPage 变量名错误导致页面不可用 - 修复 ecommerceVideoService token 读取用错 key 导致请求 401 - 修复画布连接线在弹窗出现后仍跟随鼠标的问题 - 剧本评分 .docx 文件改为服务端 mammoth 解析(新增 /api/files/extract-text) - ErrorBoundary 加 key 支持切换页面时自动重置 - Vite proxy 改为指向公网域名 omniai.net.cn - 新增视频生成历史记录面板和删除确认弹窗 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import react from "@vitejs/plugin-react";
|
|
import { compression } from "vite-plugin-compression2";
|
|
import { defineConfig, loadEnv } from "vite";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), "");
|
|
|
|
return {
|
|
plugins: [
|
|
react(),
|
|
compression({ algorithms: ["gzip", "brotliCompress"], threshold: 1024 }),
|
|
],
|
|
server: {
|
|
port: 5173,
|
|
host: "127.0.0.1",
|
|
proxy: {
|
|
"/api": {
|
|
target: env.VITE_DEV_PROXY || "https://omniai.net.cn",
|
|
changeOrigin: true,
|
|
},
|
|
"/dashscope-api": {
|
|
target: "https://omniai.net.cn",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
preview: {
|
|
port: 4174,
|
|
host: "127.0.0.1",
|
|
},
|
|
esbuild: {
|
|
drop: ["console", "debugger"],
|
|
},
|
|
build: {
|
|
sourcemap: "hidden",
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id: string) {
|
|
if (id.includes("node_modules/react") || id.includes("node_modules/react-dom") || id.includes("node_modules/scheduler")) {
|
|
return "vendor-react";
|
|
}
|
|
if (id.includes("node_modules/@ant-design") || id.includes("node_modules/antd") || id.includes("node_modules/rc-")) {
|
|
return "vendor-antd";
|
|
}
|
|
if (id.includes("node_modules/@xyflow")) {
|
|
return "vendor-xyflow";
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
}); |