build: 保留 go:embed 占位页,新克隆无需 node 即可编译

go:embed 要求目标目录存在才能编译,而构建产物不进版本库 ——
上一版把整个 gateway/internal/static/static/ 忽略掉,导致新克隆连
go build ./cmd/server 都跑不起来(pattern static: no matching files found),
只改后端的人被迫先装 node。

改为忽略目录内容但保留一个占位 index.html:说明前端未构建、给出构建命令,
并明确后端 API 仍然可用。真实产物由 install.sh 覆盖后嵌入。
This commit is contained in:
2026-09-02 10:32:41 +08:00
parent 0e754617a4
commit c73dd10f9c
2 changed files with 75 additions and 3 deletions

9
.gitignore vendored
View File

@ -9,9 +9,12 @@ web/dist/
plugins/*/node_modules/
# go:embed 的输入目录 = web/dist 的副本,同属构建产物。
# 注意 embed 要求目录存在才能编译,克隆后需先跑一次
# `deploy/install.sh`(或 npm run build && cp -r web/dist ...)。
gateway/internal/static/static/
#
# 但目录本身要留下go:embed 要求它存在才能编译,否则新克隆连
# `go test ./...` 都跑不起来 —— 只改后端的人不该被迫先装 node。
# 因此忽略里面的产物,只保留一个占位 index.html见该文件内注释
gateway/internal/static/static/*
!gateway/internal/static/static/index.html
# Go 构建产物
gateway/agentmail-gateway