tabler-icons: icons-svelte builds ALL icons, even ones not used
I’m using @tabler/icons-svelte in my sveltekit project and astro project. When building, it logs the following:
building client
transforming (8344) ../../sveltekit/fulldev-ui/node_modules/@tabler/icons-svelte/dist/svelte/icons/IconWand.svelte
The above is 1 moment in the build. It takes about 30-60 seconds and goed over every icon
Is this supposed to happen?
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 10
- Comments: 25 (4 by maintainers)
Commits related to this issue
- Remove `@tabler/icons-svelte` due https://github.com/tabler/tabler-icons/issues/669 issue — committed to LWJerri/lwjerri.dev by LWJerri 8 months ago
I’m working on it here: https://github.com/tabler/tabler-icons/pull/969 🙂
I’ve fixed it in #1039
Results:
@sapkra I’ve moved it to #993 as a part of biggest improvements
It is definitely hacky, it was just the way I had to make it work, I like tabler icons a lot. I feel this change is much more needed than any new icon, but I don’t speak for everyone.
Version 3.0.0:
Importing icons like this
Results in:
Importing icons like this
Results in:
Named imports results in all icons in the icon pack being transformed during build
I tested
3.0.0-alpha.1and the issue is still there, all icons are built regardless of how many you are using.I’ve found a “solution” to this issue over at lucide-icons lucide-icons/lucide#1944 :
This converts named imports to direct imports during transforming.
any word on this? i’m going to stop using Tabler because I can’t bear waiting many seconds for each file change with HMR