feat(hub): 支持子路径部署(--base-path) - #46
Merged
Merged
Conversation
tyanxie
commented
Aug 19, 2026
Owner
- Vite 构建使用 base: './' 相对路径,产物路径无关
- Hub 运行时注入 window.BASE_PATH 到 index.html
- 前端通过 basePath 工具模块统一处理 Router basename、API/WS 前缀
- CLI 新增 --base-path 参数,写入 hub.json,restart 自动继承
- 优先级:PAIMON_BASE_PATH 环境变量 > --base-path 参数 > hub.json 继承 > 默认 /
- 抽取 withBasePath() 工具函数统一路径拼接
- favicon 改为相对路径以兼容子路径部署
- 新增 env.d.ts 声明 Window 全局类型
- daemon.ts 抽取 normalizeBasePath 统一规范化逻辑
- Vite 构建使用 base: './' 相对路径,产物路径无关 - Hub 运行时注入 window.__BASE_PATH__ 到 index.html - 前端通过 basePath 工具模块统一处理 Router basename、API/WS 前缀 - CLI 新增 --base-path 参数,写入 hub.json,restart 自动继承 - 优先级:PAIMON_BASE_PATH 环境变量 > --base-path 参数 > hub.json 继承 > 默认 / - 抽取 withBasePath() 工具函数统一路径拼接 - favicon 改为相对路径以兼容子路径部署 - 新增 env.d.ts 声明 Window 全局类型 - daemon.ts 抽取 normalizeBasePath 统一规范化逻辑
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.