feat: 支持 CodeCC 前端子路径部署#95
Open
brookylin wants to merge 3 commits into
Open
Conversation
本次改造让 CodeCC 前端支持部署在 / 或任意配置的子路径下,并保持现有根路径访问兼容。 主要内容: - 新增 BK_SITE_PATH、BK_STATIC_URL 运行时配置,并统一路由 base、静态资源 public path、登录回调、cookie path 与内部链接处理。 - 新增路径工具方法,修正 CodeCC 内部硬编码根路径跳转,支持绝对地址、协议相对地址和子路径拼接。 - 调整本地 dev server 配置,使 npm run dev 在 BK_SITE_PATH 子路径下也能正确加载入口、异步 chunk 和 history fallback。 - 部署配置、网关环境变量、Helm 模板和 nginx 前端模板补充 BK_SITE_PATH,支持网关按配置子路径回源到前端资源。 - 新增 build 产物校验脚本、路径工具校验脚本和本地 subpath 静态服务脚本,便于验证根路径与子路径两种模式。 验证: - node ./scripts/verify-path-utils.js - node -c ./scripts/verify-subpath-dist.js - node -c ./scripts/serve-subpath-dist.js - node -c ./bk.config.js # Reviewed, transaction id: 80134
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本次改造让 CodeCC 前端支持部署在 / 或任意配置的子路径下,并保持现有根路径访问兼容。
主要内容:
新增 BK_SITE_PATH、BK_STATIC_URL 运行时配置,并统一路由 base、静态资源 public path、登录回调、cookie path 与内部链接处理。
新增路径工具方法,修正 CodeCC 内部硬编码根路径跳转,支持绝对地址、协议相对地址和子路径拼接。
调整本地 dev server 配置,使 npm run dev 在 BK_SITE_PATH 子路径下也能正确加载入口、异步 chunk 和 history fallback。
部署配置、网关环境变量、Helm 模板和 nginx 前端模板补充 BK_SITE_PATH,支持网关按配置子路径回源到前端资源。
新增 build 产物校验脚本、路径工具校验脚本和本地 subpath 静态服务脚本,便于验证根路径与子路径两种模式。
验证:
node ./scripts/verify-path-utils.js
node -c ./scripts/verify-subpath-dist.js
node -c ./scripts/serve-subpath-dist.js
node -c ./bk.config.js