advanced

Static Images

Optimizing images for static websites.

If you are building a static site using nuxt generate, Nuxt Image will optimize and save your images locally when your site is generated - and deploy them alongside your generated pages.

If you disabled server-side rendering (ssr: false in the nuxt.config), Nuxt Image won't be able to optimize your images during the static generation process.

In that case, you can tell Nuxt to pre-render images by using the nitro.prerender.routes option:

export default defineNuxtConfig({  ssr: false,  nitro: {    prerender: {      routes: [        '/_ipx/w_120/market.jpg',        '/_ipx/w_140/market.jpg',        // etc.      ]    }  }})