question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Icon Tree Shaking not working

See original GitHub issue

Version: 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:

image

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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:26 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
mshwerycommented, Apr 28, 2020

@mshwery is this something we’d want to add to v5? since it is a breaking change and all or are looking for a solution that’s backwards compatible

@Chrischuck 100% will be part of v5: Screen Shot 2020-04-28 at 1 16 11 PM

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found