Skip to content

Option to update budgets when building app or export list of initial chunk files #27941

@rubiesonthesky

Description

@rubiesonthesky

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 update angular.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:

name = basename(entry.entryPoint)
.replace(/\.[cm]?[jt]s$/, '')
.replace(/[\\/.]/g, '-');

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions