Join the Nuxt Team at Frontend Nation 4-7 June.

prerenderRoutes

prerenderRoutes hints to Nitro to prerender an additional route.

When prerendering, you can hint to Nitro to prerender additional paths, even if their URLs do not show up in the HTML of the generated page.

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.