lucide icon indicating copy to clipboard operation
lucide copied to clipboard

Nuxt auto-importing generates too many files

Open arraintxo opened this issue 3 years ago • 1 comments

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: imagen

Then all this files are downloaded on page load: imagen

arraintxo avatar Feb 07 '22 14:02 arraintxo

@arraintxo Thanks for reporting, will take a look!

ericfennis avatar Feb 09 '22 19:02 ericfennis

The same issue happens with Svelte. When loading in dev mode it loads all icons instead of just the icons I have used. image

mrmelon54 avatar Dec 05 '22 11:12 mrmelon54

Hi @ericfennis, it also happens when running astro in dev mode with lucid-solid. image

EzequielRamis avatar Mar 12 '23 15:03 EzequielRamis

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 avatar Mar 12 '23 16:03 mrmelon54

@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. image

On which version are you?

ericfennis avatar Mar 12 '23 21:03 ericfennis

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 avatar Mar 12 '23 21:03 mrmelon54

@MrMelon54 al lright good to know. Thanks for checking!

ericfennis avatar Mar 13 '23 18:03 ericfennis

I'm going to close this since Vue 2 will be EOF end of this year.

ericfennis avatar Nov 01 '23 07:11 ericfennis