refactor(build): 产物直出 dist-去掉 dist/base 中间层(outDir 统一 dist,与 UserBase 同风格),CI zip 步骤回归 cd dist,根治上提交 4b93b13 的打包路径绕法,vitest 56/56+本地 build dist 根 index.html 实测
build / build (push) Successful in 3m16s

This commit is contained in:
chenxing
2026-09-08 18:37:44 +08:00
parent 4b93b131c5
commit 604d77049b
2 changed files with 8 additions and 5 deletions
+3 -1
View File
@@ -11,7 +11,9 @@ import { cmsMockPlugin } from "./mock";
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
const outDir = command === "build" ? "dist/base" : "dist";
// 构建产物直出 dist/(与 UserBase 同风格):zip 打包/static/admin 拷贝都取 dist 根,
// 不再有 dist/base 中间层;dev(serve) 不写产物,两者共用该值无冲突
const outDir = "dist";
// VITE_IS_MOCK=true 时启用本地 mock 中间件(拦截 /api、/portal 等,无需后端)
const mockEnabled = loadEnv(mode, process.cwd(), "VITE_").VITE_IS_MOCK === "true";
return {