Files
iptvnator/apps/web
4grayandClaude Fable 5.1 eb662c4855 perf(web): bundle only the app version from package.json
The environment files and the playback diagnostic panel imported the
whole package.json (`import packageJson from '@package'`) to read its
version, and esbuild cannot tree-shake a property read on a JSON default
import, so main.js carried the complete file: scripts, dependency lists
and all. Every edit to a script or dependency moved renderer.initialBytes
even though nothing users download had changed, which is what produced
the apparent 556-byte "platform difference" between a local build made
before the perf scripts were added and the CI build made after.

Import `{ version }` instead, which esbuild tree-shakes down to the one
string. Production main.js shrinks by 11,539 bytes (renderer.initialBytes
2,751,047 -> 2,739,508) and no longer changes with package.json edits.
Jest's ESM loader exposes JSON only as a default export, so the two web
Jest configs map '@package' to a stub that serves the real file's fields
as named exports.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-26 11:12:50 +02:00
..
2025-10-07 18:02:13 +02:00