Component auto import doesn't work with custom icons
See original GitHub issueI can’t get custom icon auto component import to work with unplugin-icons.
I have a folder with svgs and I use the FileSystemIconLoader
helper to load the icons.
As soon, as I explicitly import the icons with
import Ghost from '~icons/custom-icons/ghost'
it works, but eventhough I added the following to the Components configuration, it doesn’t load the components
Components({
dts: true,
resolvers: [
IconsResolver({
customCollections: ['custom-icons'],
}),
],
}),
Here is a reproduction repo based on vitesse-lite and two fontawesome free icons as example: https://github.com/itpropro/unplugin-icons-repro
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:12
Top Results From Across the Web
Custom Icons · Issue #12 · antfu/unplugin-icons - GitHub
I know since the icons are my own, I can just pack them in the project or create my own component to load...
Read more >not able to auto import react components from node modules
Based on my testing, the auto-import functionality built into VS Code only works for symbols defined in files that are already loaded as...
Read more >unplugin-icons - npm
Import icons names with the convension ~icons/{collection}/{icon} and use them directly as components. Auto importing is also possible. React.
Read more >Auto Import | IntelliJ IDEA Documentation - JetBrains
Insert imports on paste. Select how IntelliJ IDEA should process references to missing classes, static methods, or fields in pasted blocks ...
Read more >unplugin-icons/README.md - UNPKG
17, - [Custom icons](#custom-icons) - load your custom icons to get universal ... 18, - [Auto Importing](#auto-importing) - Use icons as components ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for you detailed exploration @userquin that helped a lot! Lot’s of stuff, I didn’t find in the documentation, as soon as I integrated this, I will create a little docs PR 📜 The packages were indeed quite old and some basic configuration missing as the repo was created in a few minutes in march 😅
also working importing 1 of the icons on
src/pages/index.vue
, you can check the syntax changes: