Repository navigation
Commit c53ba4b
committed
fix(web): 关掉 auto-install-peers,去掉用不到的 antd 全家桶
`@lobehub/icons` 把 `@lobehub/ui` / `antd` 声明为 peer,pnpm 自动安装时
会拖进 400+ 个包(antd、@ant-design/*、rc-*、@emotion/*、motion 等),
而我们只 import 它的静态图标组件(`es/<Name>/components/{Color,Mono}`),
那些文件不引用 `@lobehub/ui`,也从未进过产物(dist 里搜不到 antd)。
同时 icons 6.x 声明 peer `@lobehub/ui: ^6.0.0`,自动装的却是 5.42.6,
lockfile 长期带着一个不满足的 peer。
- `.npmrc` 加 `auto-install-peers=false`:lock 从 1023 个包降到 601 个
- 真正需要的 peer 显式声明:`@testing-library/dom` 补进 devDependencies
(`@testing-library/react` 的 peer,之前靠自动安装才在)
- 副产品:`pnpm audit --prod` 从 1 条 low(katex ← @lobehub/ui → remark-math)
变成 0 漏洞,整棵子树已移除
纯删除,无版本漂移:修复后每个 (包, 版本) 都存在于修复前。
验证:`--strict-peer-dependencies` 安装通过、tsc、643 测试、build 全绿。1 parent bad65c3 commit c53ba4b
3 files changed
Lines changed: 196 additions & 4657 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
0 commit comments