Skip to content
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

feat(preset): add @mdi/js support #450

Closed
wants to merge 1 commit into from
Closed

Conversation

userquin
Copy link
Member

@userquin userquin commented Nov 24, 2023

Description

This PR includes:

  • change the context to await when preset definition is an async function, we're using dynamic import to import all the icons from @mdi/js module
  • add usage in Svelte example

Linked Issues

closes #446

Additional context

Copy link

stackblitz bot commented Nov 24, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@userquin userquin requested a review from antfu November 24, 2023 20:33
@userquin userquin changed the title feat: add @mdi/js support feat(preset): add @mdi/js support Nov 25, 2023
@antfu
Copy link
Member

antfu commented Nov 25, 2023

I am not sure to support this specific package, while we have more generic solutions like https://github.com/unplugin/unplugin-icons. We can't have presets for every single package no npm.

Btw, it's probably under-documented, but we do support auto crawling exports for packages, you can try (haven't tested):

presets: [
  { package: '@mdi/js' }
]

https://github.com/unjs/unimport/blob/b1f1d33d6a26e16857315818e84b6f345e12ef0d/src/preset.ts

@antfu antfu closed this Nov 25, 2023
@antfu antfu mentioned this pull request Nov 25, 2023
3 tasks
@userquin
Copy link
Member Author

I Will check it, if working I Will add the entry to the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add @mdi/js preset
2 participants