tabler-icons-svelte
tabler-icons-svelte copied to clipboard
build time
This is great! Excited to use it, but it seems to increase build time for me by about 6 seconds (1.8s to 8.6s) and really slows things down. Any way to optimize it?
Wow that is a lot longer. I'm new to Svelte so I will have to do some digging to find ways to optimize this package.
I noticed this build issue as well. It's running a bunch of scripts during build?
I looked at how svelte-material-ui optimized there library. What they did was create a different package for every type of component. This is harder to do for this library because the components need to be recreated every time tabler-icons is updated.
I also don’t see this as that big of an issue for development. As long as you use the --watch
option with rollup
, or if you are using sapper sapper dev
, Rollup will only recompile the components that have changed. Meaning this is only a problem for when you build for deployment. If your configuration doesn’t work like that look at the svelte template or the sapper template.
i switched over to usning snowpack to do my dev builds and since it uses modules the build is almost instant when you make a change. I did notice this however. I'm only using a handful of icons. This seems like a pretty large file
Same build issue here. A cold / first npm run dev
in sapper took up to 30s, rebuilding up to 8s and slows things down.
(OK my machine is not the latest but fast enough for almost everything...)
A working solution for me is to import every icon directly, like this:
import Bell from "tabler-icons-svelte/dist/Bell.svelte";
Hope this can be of help.
import Bell from "tabler-icons-svelte/dist/Bell.svelte";
@georks I don't know why I didn't think of that.
I'll update the readme to add that tip.