feat(@angular/build): Support splitting browser and server stats jsonfiles for easier consumption#32631
Open
tsteuwer-accesso wants to merge 2 commits intoangular:mainfrom
Open
feat(@angular/build): Support splitting browser and server stats jsonfiles for easier consumption#32631tsteuwer-accesso wants to merge 2 commits intoangular:mainfrom
tsteuwer-accesso wants to merge 2 commits intoangular:mainfrom
Conversation
… files for easier consumption This feature supports splitting out the browser and server stats json files so it's easier to inspect the bundle in various analyzers. Today, everything gets dumped into a single file and it's nearly impossible to use without hours of fix -> remove unused browser chunks -> analyze and starting the loop all over again. This feature implements the feature request I made in angular#28185, along with another developers request to see a stats json file for just the initial page bundle. I've tested this out in my own repository and it's already helped an incredible amount. Fixes angular#28185 angular#28671
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Author
|
Signed CLA. |
…at was in my main branch off of @angular/angular-cli repository This addresses an issue of including the (browser|server)-initial-stats.json file that was in my original repository. It also fixes unit tests that were also addressed in the original repo.
alan-agius4
reviewed
Mar 2, 2026
| @@ -83,9 +83,8 @@ export async function getCommonConfig(wco: WebpackConfigOptions): Promise<Config | |||
| // Once TypeScript provides support for keeping the dynamic import this workaround can be | |||
Collaborator
There was a problem hiding this comment.
This changes are unrelated and unneeded.
Please revert.
alan-agius4
reviewed
Mar 2, 2026
| @@ -208,7 +208,7 @@ | |||
| }, | |||
alan-agius4
reviewed
Mar 2, 2026
| @@ -394,7 +394,7 @@ | |||
| }, | |||
alan-agius4
reviewed
Mar 2, 2026
| @@ -406,7 +406,7 @@ | |||
| }, | |||
alan-agius4
reviewed
Mar 2, 2026
| PrerenderedRoutesRecord, | ||
| } from './bundler-execution-result'; | ||
|
|
||
| export function buildMetafileForType( |
Collaborator
There was a problem hiding this comment.
This isn't the ideal place for this logic. Since metadata is already being merged here, we should instead modify that process to skip merging for specific fields or keep them isolated from the start.
alan-agius4
requested changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This feature supports splitting out the browser and server stats json files so it's easier to inspect the bundle in various analyzers. Today, everything gets dumped into a single file and it's nearly impossible to use without hours of
fix -> remove unused browser/server chunks -> analyzeand starting the loop all over again.This feature implements the feature request I made in #28185, along with another developers request to see a stats json file for just the initial page bundle. I've tested this out in my own repository and it's already helped an incredible amount.
Fixes #28185 #28671
PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When using
--stats-json, the CLI outputs a single stats.json file.Issue Number: 28185
What is the new behavior?
We now receive a
browser-stats.json,server-stats.json,browser-stats-initial.jsonandserver-stats-initial.jsonDoes this PR introduce a breaking change?
This is a breaking change for anyone relying on CI processes that inspect the old
stats.jsonfile as it will no longer be named that.Other information