Skip to content

feat(hub): 支持子路径部署(--base-path) - #46

Merged
tyanxie merged 1 commit into
mainfrom
feat/base-path
Aug 19, 2026
Merged

feat(hub): 支持子路径部署(--base-path)#46
tyanxie merged 1 commit into
mainfrom
feat/base-path

Conversation

@tyanxie

@tyanxie tyanxie commented Aug 19, 2026

Copy link
Copy Markdown
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 统一规范化逻辑
@tyanxie
tyanxie merged commit 018105b into main Aug 19, 2026
1 check passed
@tyanxie
tyanxie deleted the feat/base-path branch August 19, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant