feat: 电商工作台进度与生成记录健壮性优化

This commit is contained in:
2026-06-15 10:24:31 +08:00
parent e1fdbe5f9b
commit 0b2d6b901f
10 changed files with 533 additions and 102 deletions
+9 -5
View File
@@ -2,8 +2,14 @@ import react from "@vitejs/plugin-react";
import { compression } from "vite-plugin-compression2";
import { defineConfig } from "vite";
export default defineConfig(() => {
const devApiTarget = process.env.OMNIAI_DEV_API_TARGET?.trim();
export default defineConfig(({ command }) => {
// dev 模式下默认把 /api 代理到线上电商后端,本地 `npm run dev` 即可直接登录/生成。
// 想连本地或 SSH 隧道的后端时,用环境变量覆盖:
// $env:OMNIAI_DEV_API_TARGET="http://127.0.0.1:3601"; npm run dev
// 仅 dev 代理用途,不会打进生产构建产物。
const devApiTarget =
process.env.OMNIAI_DEV_API_TARGET?.trim() ||
(command === "serve" ? "https://omniai.com.cn" : "");
const apiProxy = devApiTarget
? {
"/api": {
@@ -27,9 +33,7 @@ export default defineConfig(() => {
port: 4174,
host: "127.0.0.1",
},
esbuild: {
drop: ["console", "debugger"],
},
...(command === "build" ? { esbuild: { drop: ["console", "debugger"] } } : {}),
build: {
sourcemap: false,
rollupOptions: {