Shrink the npm tarball: bundled Inter TTFs are 45% of the package

未关闭
#265 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
半天
新手友好度
62/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
build-system

调研方向

Start by running npm pack --dry-run to reproduce the 571 kB packed size, then look at the two font files in assets/fonts/Inter-Bold.ttf and assets/fonts/Inter-Regular.ttf. Check src/utils/fontCoverage.ts to see which glyph ranges the CJK and emoji fallback depends on, so the subset keeps them. Done means the packed size is under 300 kB and the font and drawtext tests still pass.

由索引模型根据 Issue 内容生成。

描述

dx performance priority: low

Why it matters

npx cold starts (the main install path, including in the Action) download the whole tarball every time.

Evidence

  • npm pack --dry-run reports 571 kB packed, 1.5 MB unpacked.
  • assets/fonts/Inter-Bold.ttf (344 kB) and Inter-Regular.ttf (342 kB) make up most of it.
  • The 51 kB README also ships.

Suggested approach

Subset Inter to Latin plus common symbols. Keep TTF, since ffmpeg's freetype may lack WOFF2 support. Keep the CJK/emoji fallback in src/utils/fontCoverage.ts working, and slimming the README (see the README issue) also helps.

Done when

The packed size is under 300 kB and the font and drawtext tests pass.

主要语言
TypeScript
星标
1
派生
4
平均合并
14 小时 8 分钟
30 天内合并 PR
48

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TMHSDigital/screencast-mcp 的其他 Issue

查看 TMHSDigital/screencast-mcp 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。