Closed dany68 closed 2 months ago
Thank you for the feature request @dany68
This may bring some limitations:
What about holding a list of icons in an icons.config.ts file at the nuxt root folder ?
All those icons will be downloaded as svg in the assets/icons
folder.
When using the
Additionally we can make the following cmds:
icon add/remove {name}
that will add/remove the icon in the config file and download/delete the svg file from the assets/icon
foldericon sync
that sync the state of the assets/icon
folder with the config file (in case of manual edit)I would like to use this package for my projects but the fact that it needs to fetch on iconify client side is a blocking point. I think this approach can let the flexibility and improve performance for most apps.
Downloading the referenced icons in user code at build time would really improve the experience with iconify. It was a big gotcha for me not realising that icons are loaded from the network in production and that I can’t build offline apps with nuxt-icon.
I would love this feature too. Why not render the required icons directly from nuxt.config.ts
Something like:
icons: ["uil:github"]
formkit/icons seems to be doing something similar with a more limited set of icons.
We are in discussion with Anthony to remake this module to support all different solutions, we will keep you posted.
I created module for working with local icons (color and monotone) with nuxt-icon or any iconify module. https://github.com/adinvadim/nuxt-local-iconify
cc @antfu what do you think to support local in your new iteration based on @adinvadim work?
Hi
I would like to know if some contributors might be interested in a change of the api. I would be happy to help.
The idea is to load icons from an SVG folder inside the assets folder. To achieve this, there is a need to implement an npm command, such as
npm run icon:prepare
, that will download the used icons from Iconify during the deployment script or before pushing to the git repository.@/assets/svg/[name of the collection]/[name of the icon].svg
@/components/global
to@/assets/svg/custom
The main advantages are: