Skip to content

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

Closed
userquin wants to merge 1 commit into
mainfrom
userquin/feat-add-mdi-js
Closed

feat(preset): add @mdi/js support#450
userquin wants to merge 1 commit into
mainfrom
userquin/feat-add-mdi-js

Conversation

@userquin

@userquin userquin commented Nov 24, 2023

Copy link
Copy Markdown
Member

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

@bolt-new-by-stackblitz

Copy link
Copy Markdown

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

antfu commented Nov 25, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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