lucide
lucide copied to clipboard
Nuxt auto-importing generates too many files
When using nuxt auto-importing feature a js file is generated per icon and all of them are downloaded on first page load, this means that more than 500 petitions are sent to the server on page load. This seems to much for any application...
Prerequisites
- Version: 0.16.26
- Used on Nuxt with: lucide-vue/nuxt
- Operating system: Linux
- Bits: 64 bits
Step to reproduce
Add "lucide-vue/nuxt" to buildModules on nuxt.config.js
Actual behavior
When app is built a js file is generated for each icon. When page is loaded all this js are downloaded so more than 500 petitions are made to the server on first load.
Resources
Build process generates a file per icon:
Then all this files are downloaded on page load:
@arraintxo Thanks for reporting, will take a look!
The same issue happens with Svelte. When loading in dev mode it loads all icons instead of just the icons I have used.
Hi @ericfennis, it also happens when running astro in dev mode with lucid-solid.
I use svelte and decided it was easier to just copy each icon into my project manually instead of using the library, because of this exact issue.
@MrMelon54 hmm that should be not the case anymore with the latest version of svelte
vite
and lucide-svelte
.
This is what I just tested.
On which version are you?
Last version I tested on was 0.102.0 since then I just haven't used the library
Update: Ok after trying 0.125.0 with latest svelte and vite is works correctly
@MrMelon54 al lright good to know. Thanks for checking!
I'm going to close this since Vue 2 will be EOF end of this year.