Skip to content

bug: bundle size increase with IonicModule and lazy loaded web components in v8.0.1 #29393

Closed
@StefanNedelchev

Description

@StefanNedelchev

Prerequisites

Ionic Framework Version

v8.0.1

Current Behavior

Some extra modules seem to have been included in man JS chunk which results in drastically higher bundle size. This happened just by updating Ionic from 8.0.0 to 8.0.1 without any code changes. My project is not converted to Ionic Standalone components yet.

initial chunk files after a prod build (8.0.1):
Screenshot from 2024-04-24 18-49-33

webpack bundle analysis (the outlined module with red is the extra stuff that we never had before)
after

Expected Behavior

Main JS chunk size to remain the same or at least with a minimal impact

initial chunk files after a prod build (8.0.0):
Screenshot from 2024-04-24 18-50-53

webpack bundle analysis
Screenshot 2024-04-24 at 18-56-03 sleda 24 Apr 2024 at 18 55

Steps to Reproduce

  1. Initialize a brand new project with the CLI by selecting Angular and Modules (instead of standalone Ionic components) as a framework and use v8.0.0 (manually pin down the ionic version to 8.0.0 if necessary).
  2. Do a production build with ionic build --prod and check out the size of the output main.js file
  3. Bump the ionic version to 8.0.1 and repeat step 2

Code Reproduction URL

https://angular-ctnsgh-ifi6by.stackblitz.io

Ionic Info

Ionic:

Ionic CLI : 7.2.0 (/usr/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 8.0.1
@angular-devkit/build-angular : 17.3.5
@angular-devkit/schematics : 17.3.5
@angular/cli : 17.3.5
@ionic/angular-toolkit : 11.0.1

Capacitor:

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

Utility:

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

System:

NodeJS : v20.12.2 (/usr/bin/node)
npm : 10.5.2
OS : Linux 6.5

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    stencilIssues that require changes in Stencil

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions