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

fix(setup): Setup provider using the provider key #1420

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,13 @@ export async function resolveProvider(_nuxt: any, key: string, input: InputProvi
}

const resolver = createResolver(import.meta.url)

const setup = input.setup || providerSetup[input.provider as ImageProviderName] || providerSetup[input.name as ImageProviderName]

input.provider = BuiltInProviders.includes(input.provider as ImageProviderName)
? await resolver.resolve('./runtime/providers/' + input.provider)
: await resolvePath(input.provider)

const setup = input.setup || providerSetup[input.name as ImageProviderName]

return <ImageModuleProvider> {
...input,
setup,
Expand Down