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

Aberta
#265 2 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
Meio dia
Facilidade para iniciantes
62/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
typescript
Domínio
build-system

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
1
Forks
4
Merge médio
14h 8min
PRs com merge (30d)
48

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/screencast-mcp

Todas as issues de TMHSDigital/screencast-mcp

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.