Option to update budgets when building app or export list of initial chunk files #27941
Labels
angular/build:application
area: @angular/build
feature: insufficient votes
Label to add when the not a sufficient number of votes or comments from unique authors
feature
Issue that requests a new feature
Command
build
Description
When updating app, it would be nice to have a easy way to update application budgets in
angular.json
file. With Angular 18 and new@angular/build:application
builder it's no longer possible to script this task.I understand that this may be niche feature request. But tracking budgets helps to see, how the size changes overtime.
Describe the solution you'd like
When I run
build
, I'd like to have cli option that would updateangular.json
file and the budgets section. It's tedious to update that file manually.Describe alternatives you've considered
I have a script for this task but it does not work with the new builder. The produced
stats.json
does not have enough information. There is no information which chunks are initial and which are loaded later. Also, I'm not sure how I could map the chunks to budgets in angular.json. Before the stats.json had the same chunkName and it could be just compared with the angular.json file.This method was also nice, because I could print table that compared the values from angular.json and stats.json and see difference.
Is there a way to expose the data that builder clearly has when it prints the output table? With that data, I could update my script to work.
At least there seems to be a way to convert entryPoint to chunkName:
angular-cli/packages/angular/build/src/tools/esbuild/budget-stats.ts
Lines 46 to 48 in 5b81e0f
The text was updated successfully, but these errors were encountered: