-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Svelte gets very slow on hard refresh [dev env] #15603
Comments
This is more about Vite than Svelte |
I think the plugin doesn't make sense, since you still need to import them one by one. I will go with alias solution that I mentioned. Still bothers me that this is ongoing issue for years now and is still existing issue today. |
No you don't. This works: import { Icon1, Icon2 } from 'lucide-svelte'; |
This is a Vite problem, or rather an "icon library having one export per Icon" problem. Also see https://svelte.dev/docs/kit/icons - therefore closing. |
Describe the bug
I have noticed that svelte slows down significantly when hard refresh occurs when using any icon library (like lucide/svelte or tabler/icons-svelte), in development.
Up to few seconds to load the page, hot reloads seems to be working just fine.
It seems that app tries to load all icons at once every time.
Currently I'm bypassing this issue by making alias directly to node_modules, so i can import like this:
'@icons/arrow-left.svelte' and this solves the issue.
At first I though this was lucide issue, but once I installed tabler icons that was sure thing that this is svelte issue, because it loads even slower with tabler as they have much more icons available.
Reproduction
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: