nuxt / image

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

Full-resolution images aren't generated when using the placeholder option and SSG with nuxi generate #867

Open Smef opened 1 year ago

Smef commented 1 year ago

When building a SSG site with Nuxt and Nuxt Image, only the "placeholder" size image is generated and the full resolution image is skipped.

Example:

  <NuxtImg
      src="home/meeting.jpg"
      width="600"
      height="400"
      format="webp"
      class="max-w-full h-auto border border-solid border-zinc-400"
      alt="Top-down view of people shaking hands around a wooden table"
      :placeholder="[60,40]"
  />

This works fine with nuxi dev but when you run nuxi generate you can see that only the placeholder image is generated. The high-res, 600x400 image is never processed.

During the generate process you can see the following line where the placeholder is generated, but this is the only time the image gets processed.

  ├─ /_ipx/f_webp&q_50&s_60x40/home/meeting.jpg (10ms)      
Tragio commented 1 year ago

Have you tried with the RC version? I was trying to reproduce it but wasn't able to do so 🤔