icon icon indicating copy to clipboard operation
icon copied to clipboard

Reduce Iconify Package Size in NuxtUI – Import Only Needed Icons

Open Thomanidas opened this issue 10 months ago • 2 comments

Hello,

I'm using NuxtUI with Iconify and four collections: Material Symbols, Heroicons, let's icon and Simple Icons.

Image

However, after installing these collections and building my project, the generated packages are several megabytes in size. These packages take up about 80% of my project size, which heavily impacts performance.

Image

Image

total size of my project :

Image

I’d like to:

Import only the specific icons I use from these collections instead of including everything. Know if there’s a built-in way to achieve this in Iconify/nuxt-icon or any recommended approach.

Thomanidas avatar Jan 17 '25 07:01 Thomanidas

I am having the same issue without Nuxt UI. I included only 3 icons from solar, but it adds 6MB to the bundle.

Image

MickL avatar Jan 29 '25 21:01 MickL

+1, I just installing the fluent-emoji iconify set and my build started to fail due to out of memory issues. Adding node-options=--max-old-space-size=16384 to .npmrc allowed things to build again, but the prerender step took about 4 minutes and the package size was over 30 mb.

mikeswart avatar Feb 18 '25 20:02 mikeswart

just stumbled up on the same problem!

simonmaass avatar Jun 03 '25 08:06 simonmaass

It may be that your server bundling mode is local. As pointed by the documentation, maybe you can consider changing the server bundling mode to remote or externalizing the icons JSON.

toto6038 avatar Jun 04 '25 20:06 toto6038