New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't tree shake when bundled with Webpack and Create React App #574
Comments
You may need to import from |
Oh alright, will do. Thank you very much @codsane |
I'm experiencing this issue through https://github.com/rjsf-team/react-jsonschema-form To the point that most of the weight comes from react-icons, a sub-dependendency of react-jsonschema-form. I looked at their code and they're using the same code suggested in your readme. How come it's failing? Other libraries are being treeshaken, like Lodash. |
As seen by the recent comments and mentions in #154, this issue persists and I think it should be fixed in the main package instead of forcing people to discover this on their own and have to fix it every time. |
I agree. Thanks to you both, guys! |
What is |
Could make sense to publish all the icon packs as treeshakeable individual packages then 🤔 such as |
Describe the bug
React-icons 4.2.0 when bundled with Webpack is importing the entire libraries even when specified to import just one icon. Resulting in 95% of unused code.
import { CgArrowsShrinkH as Shrink } from 'react-icons/cg'
Expected behavior
I'm expecting to see only the Shrink icon imported.
Screenshots
Version: 4.2.0
OS: Windows 10
Browser: Chrome 102.0.5005.11
The text was updated successfully, but these errors were encountered: