Icon Tree Shaking not working
See original GitHub issueVersion: 4.26 Bundler: Create-React-App default (Webpack)
Hello, I updated to the latest version to take advantage of tree-shaking but am still seeing all of the icons in my bundle:

I am not using the Icon
component anywhere in my app. I do, however, use Menu
and Menu.Item
and am wondering if the icon prop on Menu.Item is causing all icons to be included.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:26 (19 by maintainers)
Top Results From Across the Web
Tree-shaking not working correctly (react-icons) #27276
Description When react-icons is used, all of the icons in the set are included in the bundle. Steps to reproduce Clone and develop/build ......
Read more >Tree-Shaking | Font Awesome Docs
The Font Awesome icon packages support tree-shaking out of the box but only if your tool ... In the meantime, if you're facing...
Read more >This application cannot tree shake icons fonts - Stack Overflow
Try build with --no-tree-shake-icons command.
Read more >How to build your own tree shakable SVG icons library in less ...
The most common techniques to achieve this are tree-shaking, aka dead code elimination, and lazy loading. We are going to build our icons...
Read more >Minimizing bundle size - Material UI - MUI
Tree-shaking of MUI works out of the box in modern frameworks. ... Anything deeper is considered private and can cause issues, such as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/segmentio/evergreen/pull/818
@Chrischuck 100% will be part of v5: