Skip to content
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

Pro icons (@hugeicons/react) don't tree-shake and increase bundle size by a lot #17

Closed
alea-git opened this issue Dec 27, 2024 · 3 comments

Comments

@alea-git
Copy link

alea-git commented Dec 27, 2024

Hi!

I've recently purchased the Pro version of hugeicons (@hugeicons/react) and using it in a NextJS app. And I've noticed a huge increase in bundle size because of it.

In particular our minified+gzipped bundle went from 400kb to 600kb, basically a 50% increase just because of the icons we use.

So I went through the rabbit hole, and apparently it's because every icon included in the app comes with all variants, automatically.

Ex: I want to use ArrowRight01Icon, hugeicons includes all stroke, solid, twotone, bulk variants, even though they're never used.

Can you do anything about it? This is a deal breaker for us (and I'm sure a lot of other projects).

@hugeicons
Copy link
Owner

Hi.

We are working on this, and will fix it very soon.

@alea-git
Copy link
Author

Such a good news to hear! Any ETA?

@hugeicons
Copy link
Owner

@alea-git We have published @hugeicons/[email protected] that supports tree-shaking for icons and variants, you can check it and let us know if you face any issues.

You can now import icons that include all variant as:
Home01Icon

Or you can import single variant like:
Home01IconBulkRounded
Home01IconDuotoneRounded
Home01IconSolidRounded
Home01IconSolidSharp
Home01IconSolidStandard
Home01IconStrokeRounded
Home01IconStrokeSharp
Home01IconStrokeStandard
Home01IconTwotoneRounded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants