mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
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>
174 B
174 B
type, area
| type | area |
|---|---|
| perf | web |
The app no longer ships its whole package.json inside the startup bundle,
only its version number, which trims about 11 KB from every launch.