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

sizes and placeholder attribute do not work in preset from nuxt.config.ts #1256

Open
BananaAcid opened this issue Feb 19, 2024 · 1 comment

Comments

@BananaAcid
Copy link

It might also be me, but I found no documentation on how to configure sizes and placeholder in the docs.

It did not work, but
I expected to be able to use a preset to configure the params for a NuxtImage:

export default defineNuxtConfig({
  modules: [
    ["@nuxt/image", {
      quality: 60,
      format: ['webp'],
      
      presets: {
        hero: {
          sizes: {sm:'50vw', md:'100vw', lg:'150vw', xl:'400vw'},
          placeholder: true,
          
          modifiers: { // passed into the URI
            quality: 70
          }
        }
      }
    }],
  ]
});
@geminigeek
Copy link

geminigeek commented Feb 19, 2024

same here, format, alias is also not working from nuxt.config.ts , however format works directly using prop!

image: {
    quality: 80,
    format: ['avif', 'webp'],
    domains: ['example.org'],
    alias: {
      example: 'https://example.org'
    }
}

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

No branches or pull requests

2 participants