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

build time #1

Open
russellsamora opened this issue Nov 2, 2020 · 6 comments
Open

build time #1

russellsamora opened this issue Nov 2, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@russellsamora
Copy link

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?

@benflap
Copy link
Owner

benflap commented Nov 3, 2020

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.

@benflap benflap added the enhancement New feature or request label Nov 3, 2020
@jmsunseri
Copy link

I noticed this build issue as well. It's running a bunch of scripts during build?

@benflap
Copy link
Owner

benflap commented Jan 2, 2021

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.

@jmsunseri
Copy link

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

image

@georks
Copy link

georks commented Jan 21, 2021

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.

@benflap
Copy link
Owner

benflap commented Jan 21, 2021

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.

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

No branches or pull requests

4 participants