NuxtN
Nuxt16mo ago
Yendy

NuxtImg not working with dynamic :src with SSG

I'm not sure if I'm missing something here, but when I
pnpm run generate
for my Nuxt 3 site, during static generation, any NuxtImg that uses a dynamic source is not generated. I'm not sure how to ensure that every image in my /public directory is crawled during static generation.

It seems to only create and store images in _ipx if they are statically typed as a source, like:

<NuxtImg src="/image1.jpg" />


but if I have:

const source = "/image1.jpg"
<NuxtImg :src="source"/>


it will not find the file for ipx. Is there a way I can configure this?

Thanks!
Was this page helpful?