-
-
Notifications
You must be signed in to change notification settings - Fork 909
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
Bundle size extreme large, transforming all icons when build #1161
Comments
Hi, this is project about Tabler Dashboard, Tabler Icons are here: https://github.com/tabler/tabler-icons |
I also had this issue where building my app would include all the icons. The annoying part is that each import only adds a single icon, so you have to do it multiple times if you use a lot of icons. |
Thank you. I will try your approach to import icons directly |
I have the same issue with |
@Nradar While writing this I realised I meant to comment on #793 instead. Either way it is to illustrate that adding the library and an icon to a page adds less than 1 KB, meaning that selective imports work as expected, using the default syntax, as opposed to "transforming all icons when built" (the title). I'm not sure if it solves your problem with the library. You might wanna treat it as prod or peer dependency rather than a dev dependency. |
Browser
chrome
OS
windows 10
Screen size
1920x1080
Describe the bug
Hi All! I have project(called A) built with remix/vite, and it include my other library(called B) built based on storybook and vite. Both A and B have installed @tabler/icons-react as dev dependency.
When I build library B itself, the tabler icons are doing okay, only include icons been imported in the build. But when I build the project A, all of the tabler icons in B are all transforming and packed into build/client/assets/B.js. It occupied a huge bundle size. I'm not sure if this is related to treeshaking or some configs? Hope someone can help me on this! Thanks in advance.
Project A vite config:
Library B vite config:
How to reproduce
Screenshots
No response
JSFiddle
No response
The text was updated successfully, but these errors were encountered: