Vite is grabbing all imports from libriaries instead of tree-shaking whats used. #10742
Closed
7 tasks done
Labels
duplicate
This issue or pull request already exists
Describe the bug
I have plain Svelte project in which I am using icons from
lucide-svelte
. When ever my page in svelte refreshes, whether its HMR or I reload the page manually myself, it will grab every single icon from this library making my load time go from 1-2 seconds to up to 16 seconds.I have included a link to a Svelte REPL. You can see it grabbing all the icons there, as well as you can recreate it with the steps below.
Reproduction
https://svelte.dev/repl/84544b7545e14ccbb90541c955bf6473?version=3.52.0
Steps to reproduce
Inside of App.svelte import any icon from lucide-svelte, and then open the developer tab and go to network and refresh the page, you will see it is importing every icon from the package, as compared to just the icon package.
Issue via LucideIcons github
System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: