Significant Build Size Increase with @nuxt/icon and Deprecation Warnings from @iconify
After integrating @nuxt/icon into my project, I noticed a significant increase in the build size from approximately 2MB to 14MB. This issue persists even though I am not using any <Icon /> elements in my components. Additionally, I am encountering numerous deprecation warnings related to @iconify.
It appears that @nuxt/icon is downloading all icon collections instead of only the icons being used, leading to the substantial increase in build size.
Before adding @nuxt/icon
After adding @nuxt/icon, @iconify-json/heroicons and @iconify-json/tabler
The build size should not increase significantly, especially when no <Icon /> elements are used.
If relevant, here are the versions I am using:
Nuxt Version: 3.12.3
@nuxt/icon Version: ^1.0.0
@iconify-json/heroicons: ^1.1.21
@iconify-json/tabler: ^1.1.116
Node.js Version: v20.13.1
A ton of deprecation warnings like these
(node:23176) [DEP0166] DeprecationWarning: Use of deprecated double slash resolving ".//index.cjs" for module request ".//index.cjs" matched to "./*" in the "exports" field module resolution of the package at ...\node_modules\@iconify\vue\package.json imported from ...\node_modules\nuxt-og-image\dist\node_modules\_index.js.
Thank you in advance for your help in fixing this issue! :)
Related #184.
Try setting serverBundle: false in the configuration. This will prevent loading the collections used by nuxt-dev-kit.