Skip to content
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

Update bundle meta when using NG_BUILD_OPTIMIZE_CHUNKS #28830

Open
1 task
ChristopherPHolder opened this issue Nov 9, 2024 · 0 comments
Open
1 task

Update bundle meta when using NG_BUILD_OPTIMIZE_CHUNKS #28830

ChristopherPHolder opened this issue Nov 9, 2024 · 0 comments

Comments

@ChristopherPHolder
Copy link

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When we run a build with NG_BUILD_OPTIMIZE_CHUNKS the stats.json file is not updated so it will show build with the old bundles and not the new ones.

This makes it harder to analyse the build output.

Minimal Reproduction

Run ng build --statsJson on any project using the NG_BUILD_OPTIMIZE_CHUNKS environment variable.

Then open the stats.json on https://esbuild.github.io/analyze/

You should clearly notice that the old chunks before the optimization are present and the changes on main are not reflected.

Image

Image

Exception or Error


Your Environment

Angular CLI: 18.2.6
Node: 22.10.0
Package Manager: npm 10.9.0
OS: win32 x64

Angular: 18.2.6
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1802.6
@angular-devkit/build-angular   18.2.6
@angular-devkit/core            18.2.6
@angular-devkit/schematics      18.2.6
@schematics/angular             18.2.6
rxjs                            7.8.1
typescript                      5.5.4
zone.js                         0.14.10

Anything else relevant?

Potential solution is to adapt the meta data eg:

https://github.com/push-based/ngx-build/blob/ec331e177e43f2c45d4f56b4df4d87a20a5fabfd/packages/esbuild-plugin/src/lib/bundle-adaptor.utils.ts

I am happy to contribute and help if can :)

Related:

@alan-agius4 alan-agius4 added feature Issue that requests a new feature severity2: inconvenient area: @angular/build and removed feature Issue that requests a new feature labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants