From 7aee8c3ba4c29264245525f429448556d31b99f5 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Tue, 23 Jun 2026 17:19:54 +0200 Subject: [PATCH] fix(scripts): use 1000 instead of 1024 to compute KB in bundle size script 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. --- scripts/list-npm-bundle-sizes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/list-npm-bundle-sizes.sh b/scripts/list-npm-bundle-sizes.sh index a3e2a455ce..3fe63ae0f9 100755 --- a/scripts/list-npm-bundle-sizes.sh +++ b/scripts/list-npm-bundle-sizes.sh @@ -35,7 +35,7 @@ for bundle in "${BUNDLES[@]}"; do exit 1 fi size_bytes=$(stat --format=%s "$file") - size_kb=$(LC_NUMERIC=C awk "BEGIN {printf \"%.1f\", $size_bytes / 1024}") + size_kb=$(LC_NUMERIC=C awk "BEGIN {printf \"%.1f\", $size_bytes / 1000}") # Format bytes with space as thousands separator (e.g. 998629 -> "998 629") size_bytes_fmt=$(echo "$size_bytes" | sed ':a;s/\B[0-9]\{3\}\>/ &/;ta') names+=("$bundle")