-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
All icons ending up in final bundle #926
Comments
This is quite odd. It may be related to handling of |
We're hitting something similar, using HeroIcons with Remix (esbuild). If I change all our imports to use this format, then tree shaking works and we don't end up with every icon in our build:
|
Bit of an update for y'all: I can produce a tree-shaken build when using either esbuild or rollup directly in a test repo. However, when compiling with Vite 4.1 things are not tree-shaken when |
I just published v2.0.15 which adds @DaLukasTI This should hopefully be fixed for you now. |
@thecrypticace . It does fix the issue of adding all icons to the final build and only the icons we use throughout our app. |
@DaLukasTI good to know. I'm not sure if there's anything that we can specifically do about that difference. That's really up to how the bundler just splits the files and for whatever reason it's now splitting the chunks a bit differently |
Hi,
I have noticed that with Vite 4.1.1 and the latest version of the heroicons (2.0.14) all the icons are ending up in my final bundle.
If I downgrade heroicons to 2.0.13 only the ones used end up in my bundle as they always did.
However if i downgrade Vite to 4.0.4 and keep heroicons on 2.0.14 only the ones used are ending up in my bundle as well.
I do however prefer to keep vite at it's latest version and pin the icons on a specific version for now.
I would love to help out wherever I can!
Kind regards.
The text was updated successfully, but these errors were encountered: