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

Offen
#265 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
Ein halber Tag
Anfängerfreundlichkeit
62/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
build-system

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
TypeScript
Sterne
1
Forks
4
Ø Merge
14 Std. 8 Min.
Gemergte PRs (30 T.)
48

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TMHSDigital/screencast-mcp

Alle Issues in TMHSDigital/screencast-mcp

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.