-
-
Notifications
You must be signed in to change notification settings - Fork 144
Configure to bundle icon sets #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Personally, what I am trying to solve is a workflow with which I could provide an icon list (or bundle), and be able to use them dynamically with a component, like the following: <icon :icon="menu.icon" class="w-4" /> I'm conflicted about where the logic should be. I like @NoelDeMartin's idea about having a directory from which icons are loaded, but that implies a dependency on Assuming the logic would be implemented in // some logic to import/generate iconify JSON bundles with only what you need
// https://github.com/antfu/vite-plugin-icons/issues/12#issuecomment-774391679
const collections = [/* ... */]
// in Vite's plugin definitions
Icons({
component: 'icon', // would be the default
directory: './assets/icons', // would be the default
collections // would be empty by default
}),
I'd give this a shot but I'm not familiar with Iconify yet and it doesn't seem to be typed, and I'm not familiar with Vite's plugin API either, so before diving in I wanted to know if you can see a flaw that I'd have missed in this. |
Sounds good and feel free to give it a shot! Do you think it's better to explicitly name it |
Alright, I'll try to work on that if I can find some time. And yes, it's a better name. 👍 EDIT - Not a lot of time to hack around right now, so anyone feel free to try |
Let's continue the discussion in #12. |
Provide a configuration to bundle a specified set of icons and load them sync/asynchronously.
Originally posted by @antfu in #7 (comment)
The text was updated successfully, but these errors were encountered: