bug: bundle size larger than expected with ionic 6 + webpack
See original GitHub issuePrerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
Current Behavior
This is a follow-up to https://github.com/ionic-team/ionic-framework/issues/24280, which was closed as fixed. Unfortunately, I am still having the same issue-- in Ionic 5, with a React app, the first big chunk of my app was about 500 Kb, but with Ionic 6, it’s 1.4 MB.

I also tried using the tool’s "show bundle content (inaccurate) option:

What surprised me about the above result is that it shows that ion-slides
, ion-accordion-group
, ion-breadcrumb
, and other components that I do not use in my app are being pulled in, so this is likely the source of the bloat.
Expected Behavior
I expected Ionic 5 and 6 to be roughly the same size.
Steps to Reproduce
Update a moderately sized app from v5 to v6. I am using CRA5 with Webpack 5.
Tested with webpack-bundle-analyzer
react-scripts build --stats; webpack-bundle-analyzer build/bundle-stats.json
Code Reproduction URL
No response
Ionic Info
Ionic:
Ionic CLI : 6.18.1 (/home/anon/.npm-global/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/react 6.0.13
Capacitor:
Capacitor CLI : 3.4.3 @capacitor/android : 3.4.3 @capacitor/core : 3.4.3 @capacitor/ios : 3.4.3
Utility:
cordova-res : 0.15.4 native-run : 1.5.0
System:
NodeJS : v16.14.1 (/usr/bin/node) npm : 8.5.0 OS : Linux 5.10
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
@liamdebeasi Ok thanks. I had some more time to look at this and I see that the actual bundles are correct, and the
webpack-bundle-analyzer
output is inaccurate.I’ll close this now as the issue is completely solved in the latest release. Many thanks for such a thorough solution!
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.