Skip to content

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

@BananaAcid

Description

@BananaAcid

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
          }
        }
      }
    }],
  ]
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions