nuxt / image

Plug-and-play image optimization for Nuxt applications.
https://image.nuxt.com
MIT License
1.33k stars 271 forks source link

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

Open Tofandel opened 1 month ago

Tofandel commented 1 month ago

๐Ÿ”— Linked issue

Fixes #1414

โ“ Type of change

๐Ÿ“š Description

Because the name is user provided and can (and should be different if we have multiple instances of one provider) then any name different than the provider name (eg: my-remote-ipx instead of ipx) will not setup the provider as expected

Tofandel commented 1 month ago

Drafting this for now as there is some weird things going on with ipx

if (typeof p.setup === "function" && p.name !== "ipx" && p.name !== "ipxStatic") {
        await p.setup(p, options, nuxt);
}

Because we can't use nitro so early

danielroe commented 4 weeks ago

would you be able to add an example of the usage you have in mind, perhaps by adding it to the test fixture? ๐Ÿ™