Skip to content

fix(scripts): compute bundle size KB with 1000 not 1024#3534

Merged
tbouffard merged 2 commits into
masterfrom
chore/fix_kb_in_scripts_computing_npm_bundle_size
Jun 24, 2026
Merged

fix(scripts): compute bundle size KB with 1000 not 1024#3534
tbouffard merged 2 commits into
masterfrom
chore/fix_kb_in_scripts_computing_npm_bundle_size

Conversation

@tbouffard

@tbouffard tbouffard commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Fixes the byte-to-kilobyte conversion divisor in scripts/list-npm-bundle-sizes.sh from 1024 to 1000
  • kB (kilobyte) is conventionally 1000 bytes in the context of file/bundle sizes, matching how npm and most bundler tools report sizes
  • The previous value (1024) produced KiB (kibibyte) values, causing a mismatch with the expected reporting unit

Test plan

  • Run npm run build-bundles and then bash scripts/list-npm-bundle-sizes.sh to verify sizes are reported in kB (consistent with npm output)

…cript

Kilobyte (kB) is conventionally 1000 bytes in the context of file/bundle sizes,
matching how npm and most bundler tools report sizes. Using 1024 was producing
values in KiB, not kB, causing a mismatch with expected reporting units.
@tbouffard tbouffard added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label Jun 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

@tbouffard tbouffard changed the title fix(scripts): use 1000 instead of 1024 to compute kB in bundle size script fix(scripts): compute bundle size KB with 1000 not 1024 Jun 24, 2026
@tbouffard
tbouffard merged commit 16d3cc4 into master Jun 24, 2026
12 checks passed
@tbouffard
tbouffard deleted the chore/fix_kb_in_scripts_computing_npm_bundle_size branch June 24, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant