From 3cf207bcbbb8f65994489820c14a79285d3c62a9 Mon Sep 17 00:00:00 2001 From: CJACK Date: Mon, 16 Feb 2026 20:38:31 +0800 Subject: [PATCH] fix: Set Vercel output directory to `static/admin` and update deployment documentation to clarify this configuration. --- DEPLOY.en.md | 15 +++++++++++++++ DEPLOY.md | 14 ++++++++++++++ vercel.json | 1 + 3 files changed, 30 insertions(+) diff --git a/DEPLOY.en.md b/DEPLOY.en.md index 10341e1..8ac9927 100644 --- a/DEPLOY.en.md +++ b/DEPLOY.en.md @@ -132,6 +132,21 @@ Another common root cause (Go monorepo + `internal/`): This usually happens when the Vercel Go entrypoint imports `internal/...` directly. This repo now avoids that by using a public bridge package: `api/index.go` -> `ds2api/app` -> `internal/server`. +If you see: + +```text +No Output Directory named "public" found after the Build completed. +``` + +Vercel is validating frontend output against `public`, while this repo emits WebUI assets to `static/admin`. +`vercel.json` now explicitly sets: + +```json +"outputDirectory": "static/admin" +``` + +If you manually changed Output Directory in Project Settings, set it to `static/admin` (or clear it and let repo config apply). + ## 4. Reverse Proxy (Nginx) Disable buffering for SSE: diff --git a/DEPLOY.md b/DEPLOY.md index a063b2b..75b3d90 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -131,6 +131,20 @@ Error: Command failed: go build -ldflags -s -w -o .../bootstrap .../main__vc__go 这通常发生在 Vercel Go 入口文件直接 `import internal/...`。 当前仓库已通过公开桥接包 `app` 解决:`api/index.go` -> `ds2api/app` -> `internal/server`。 +若看到类似报错: + +```text +No Output Directory named "public" found after the Build completed. +``` + +说明 Vercel 正在按 `public` 校验前端产物目录。当前仓库前端产物目录是 `static/admin`,已在 `vercel.json` 显式配置: + +```json +"outputDirectory": "static/admin" +``` + +若你在项目设置里手动改过 Output Directory,请同步改为 `static/admin` 或清空让仓库配置生效。 + ## 4. 反向代理(Nginx) 如果在 Nginx 后挂载,建议关闭缓冲以保证 SSE: diff --git a/vercel.json b/vercel.json index 174e02f..cef374e 100644 --- a/vercel.json +++ b/vercel.json @@ -1,6 +1,7 @@ { "version": 2, "buildCommand": "npm ci --prefix webui && npm run build --prefix webui", + "outputDirectory": "static/admin", "functions": { "api/index.go": { "includeFiles": "static/admin/**"