Open hartmut-co-uk opened 1 year ago
I've tested with following config:
export default defineNuxtConfig({
modules: [
'@nuxt/image-edge'
],
image: {
provider: 'ipx',
ipx: {
modifiers: {
quality: '80',
format: 'webp',
}
}
}
}
This works just fine and is applied to all nuxt-img as a default, also can be overwritten if required. Though type validation fails.
=> So I think it's actually just a missing type def in IPXOptions?
is it working fine ? because ipx options exclude modifiers
at the time of writing it was working, I no longer can confirm the exact version though...
@sungeunl is it not working for you anymore?
I can confirm, still works with "@nuxt/image": "1.0.0-rc.3"
. But still with a type error.
But:
avif
for example, and you're visiting the site with the latest MS Edge (Which doesn't support avif), it will not fallback. Even though my config looks like this:image: {
format: ['avif', 'webp', 'jpeg', 'png'],
provider: 'ipx',
ipx: {
// @ts-expect-error https://github.com/nuxt/image/issues/657#issuecomment-1326334555
modifiers: {
format: 'avif',
},
},
},
<NuxtImg format="svg" />
, add it to the image.format
option array and to the ipx.modifiers.format = 'avif,svg'
So overall, not a good solution I think
I'd like to configure a default image format for all images via nuxt config:
Questions
Refs