Skip to content

Excessive number of chunks in Angular downgrading performance #30660

Closed as duplicate of#27715
@albanx

Description

@albanx

Command

new

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

I am not going to add many details as I see that this has been reported many times:
#26307
#27321
#27418

But I would say this should be address, there should be an option to configure the chunk strategy.
When Angular was using Modules, and lazy routes the chunk strategy was simple based on lazy load modules.

Now I think this has got out of hand, networks connection/devices are not the same for all users

Image

Minimal Reproduction

Create a simple Angular app on version 17+ and observe the number of chunks.

Exception or Error


Your Environment

Angular CLI: 20.0.3
Node: 20.19.0
Package Manager: npm 10.8.2
OS: win32 x64

Angular: 20.0.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2000.3
@angular-devkit/core         20.0.3 (cli-only)
@angular-devkit/schematics   20.0.3
@angular/build               20.0.3
@angular/cdk                 20.0.3
@angular/cli                 20.0.3
@angular/material            20.0.3
@angular/ssr                 20.0.3
@schematics/angular          20.0.3
rxjs                         7.8.2
typescript                   5.8.3
zone.js                      0.15.0

Anything else relevant?

@mgechev I recall you last time were calling for community suggested feature, considering the number of times this issue is appearing maybe this can be a feature to consider in the next release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions