-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Budget warnings calculated incorrectly with esbuild builder #29040
Labels
angular/build:application
area: @angular/build
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Comments
It seems that format-bytes uses multiplier 1000 but bundle calculator uses 1024. I think, it would be nice, that with 1024 multiplier the unit would be |
Patching bundle calculator to use |
alan-agius4
added
type: bug/fix
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
angular/build:application
area: @angular/build
labels
Dec 4, 2024
alan-agius4
changed the title
Budget warnings calculated inccorectly with esbuild builder
Budget warnings calculated incorrectly with esbuild builder
Dec 4, 2024
santoshyadavdev
added a commit
to santoshyadavdev/angular-cli
that referenced
this issue
Dec 28, 2024
13 tasks
Thanks @rubiesonthesky your initial investigation saved me lot of time, raised a PR to fix this issue |
santoshyadavdev
added a commit
to santoshyadavdev/angular-cli
that referenced
this issue
Dec 28, 2024
santoshyadavdev
added a commit
to santoshyadavdev/angular-cli
that referenced
this issue
Jan 7, 2025
santoshyadavdev
added a commit
to santoshyadavdev/angular-cli
that referenced
this issue
Jan 7, 2025
santoshyadavdev
added a commit
to santoshyadavdev/angular-cli
that referenced
this issue
Jan 7, 2025
This PR makes change to kB value which was incorrect earlier Fixes angular#29040
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
angular/build:application
area: @angular/build
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Command
build
Is this a regression?
The previous version in which this bug was not present was
18 (Well, with webpack, I did not test esbuild builder with Angular 18)
Description
This inconsistency is between esbuild and webpack builders. I have set that "styles" budget is
310.82kB
, but I get warning while building sayingstyles failed to meet minimum budget. Budget 317.25 kB was not met by 6.44 kB with a total of 310.82 kB.
.After writing scripts to calculate these sizes myself, it seems that in version 18 with webpack builder, bytes where converted to
kB
with multiplier1024
. With esbuild, it seems thatkB
sizes are calculated with multiplied1000
. So whenstats.json
saysbytes: 34607
, you need to multiply it with 1000 to get the same size thatbuild
report givesBut then it gives warnings
My
angular.json
has thisSo I think those warnings are reported incorrectly. It seems that the values are taken from
angular.json
and then multiplied to get317.25 kB
and35.34 kB
when they should not be multiplied.Minimal Reproduction
I can repro this with new Angular 19 app, which uses
"builder": "@angular-devkit/build-angular:application",
I added budget constraint to
angular.json
After which I get warning
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: