Skip to content

bug: the minified main chunk in Angular increased with 130 KB after upgrading to v6 #24352

Description

@StefanNedelchev

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

After doing a production build, the main chunk is about 130 KB larger than it used to be.

Before:

Initial Chunk Files                        | Names              |      Size
main.846d9ce5796d1dd1c04a.js               | main               | 346.31 kB

After upgrading to v6 following the official guide.

Initial Chunk Files                        | Names             |      Size
main.ec6b181d25127e7a.js                   | main              | 476.77 kB

Expected Behavior

I would expect the main chink to remain more or less the same in size, not to jump so drastically without introducing any changes to my existing code.

Steps to Reproduce

  1. Create a fresh Ionic project with the latest CLI by selecting Angular as a framework and some of the starter templates (in my case I selected side menu).
  2. After the repo is initialized, run ionic build --prod to create a production build and record the size of the main JS chunk
  3. Upgrade to Ionic v6 following the official guide
  4. Run ionic build --prod to create a production build and record the size of the main JS chunk
  5. Compare both sizes. You should notice a great increase after the upgrade.

Code Reproduction URL

sdfsdf

Ionic Info

Ionic:

Ionic CLI : 6.18.1 (C:\Users\Stefan\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 6.0.0
@angular-devkit/build-angular : 13.0.4
@angular-devkit/schematics : 12.1.4
@angular/cli : 13.0.4
@ionic/angular-toolkit : 4.0.0

Capacitor:

Capacitor CLI : 3.3.3
@capacitor/android : not installed
@capacitor/core : 3.3.3
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 1.5.0

System:

NodeJS : v14.18.1 (C:\Program Files\nodejs\node.exe)
npm : 6.14.15
OS : Windows 10

Additional Information

Notice how the @angular-devkit/schematics`` package logged by ionic info has a version 12.1.4. Later I manually installed dev dependency `@angular-devkit/schematics` with version 13 .0.4 and also updated @ionic/angular-toolkit to v5.0.3 but the bundle size didn't seem to change.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions