prerenderRoutes v3.8

Source
prerenderRoutes hints that an additional route should be prerendered.

When prerendering, you can hint that additional paths should be prerendered, even if their URLs do not show up in the HTML of the generated page. Nuxt collects the hints and passes them to your server builder's prerenderer (Nitro by default).

prerenderRoutes can only be called within the Nuxt context.
prerenderRoutes has to be executed during prerendering. If the prerenderRoutes is used in dynamic pages/routes which are not prerendered, then it will not be executed.
const route = useRoute()

prerenderRoutes('/')
prerenderRoutes(['/', '/about'])
In the browser, or if called outside prerendering, prerenderRoutes will have no effect.

You can even prerender API routes which is particularly useful for full statically generated sites (SSG) because you can then $fetch data as if you have an available server!

prerenderRoutes('/api/content/article/name-of-article')

// Somewhere later in App
const articleContent = await $fetch('/api/content/article/name-of-article', {
  responseType: 'json',
})
Prerendered API routes in production may not return the expected response headers, depending on the provider you deploy to. For example, a JSON response might be served with an application/octet-stream content type. Always manually set responseType when fetching prerendered API routes.