Skip to main content

compare-array-bundle-size

Quickly compare the posthog-js array.js bundle size in the current working tree against a git baseline using the repository's esbuild proxy. Use when asked about array.js size, bundle-size percentage changes, whether browser SDK changes increased the bundle, or for a fast size check that should not run the production Rollup build.

Datos de origen

Repositorio
posthog/posthog-js
Última actividad en el origen
23 de julio de 2026 a las 18:38
Idioma detectado de SKILL.md
inglés
Estrellas
634
Forks
365

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
name
compare-array-bundle-size
description
Quickly compare the posthog-js array.js bundle size in the current working tree against a git baseline using the repository's esbuild proxy. Use when asked about array.js size, bundle-size percentage changes, whether browser SDK changes increased the bundle, or for a fast size check that should not run the production Rollup build.
compatibility
Requires a posthog-js checkout with dependencies installed.
# Compare `array.js` bundle size Use the repository's fast comparison command. Do not run TypeScript compilation, Terser, Rollup, Turbo, or the full build unless the user separately requests production bundle numbers. ## Workflow 1. Use the baseline named by the user. If none is given, let the script default to `origin/main` and then `main`. 2. From the repository root, run: ```bash pnpm bundle-size:array [baseline-ref] ``` 3. Report: - the resolved baseline ref and commit - minified percentage and byte change - gzip percentage and byte change - Brotli percentage and byte change - elapsed time 4. Lead with the percentage most relevant to the user's question. If they did not specify one, lead with minified and include the compressed results below it. ## Interpretation - The command builds both source trees with the same esbuild version, options, installed dependencies, and workspace-source aliases, so the percentage is an apples-to-apples comparison. - The current side includes tracked, uncommitted, and imported untracked source changes from the working tree. - The baseline side is a temporary source snapshot from the resolved git commit; the command does not check out or modify the working tree. - Treat the result as a fast directional comparison. Absolute bytes differ from the production Rollup/Terser output. - A positive percentage is a size increase; a negative percentage is a reduction. ## Validation and troubleshooting - To verify the comparison machinery itself, run `pnpm bundle-size:array HEAD`. With no relevant uncommitted source changes, every row should report `0.00%`. - If the baseline ref cannot be resolved, ask for another local git ref or fetch it only with the user's approval when network access is required. - If esbuild or other dependencies are missing, explain that dependencies must be installed. Do not substitute the full production build.
Ver en GitHub