Skip to content

Commonly Asked Questions

TJ Egan edited this page Nov 17, 2020 · 2 revisions

Icons are making my bundle huge

The icons should be tree-shaken from bundles. More often than not when they aren't being removed from the bundle it is due to an import from a CommonJS entry point (the lib folder) or a misconfiguration by the bundler or framework.

Here's a quick example with create-react-app:

With only icons-react

Screen Shot 2020-11-17 at 14 51 56

Screen Shot 2020-11-17 at 14 50 49

With carbon-components-react and icons-react

Screen Shot 2020-11-17 at 14 52 22 Screen Shot 2020-11-17 at 14 52 37