generate vs prerender

I have a site which is mainly static, but has a couple of server/api endpoints.

From what I understand / have experienced in development, I can't use nuxi generate as I need a live Nitro instance to manage API requests.

As the site is static, but I need Nitro, should I use route rules to prerender everything?

  routeRules: {
    '**': { prerender: true },
  },


I just want to get clear on a) the best pipeline to get the best performance and b) to have a better understanding of what Nuxt does to give users a site (as it's not like PHP where you can see the phsical files from the outset).

From what I can see in the .output folder:

  • nuxi generate / serve creates / serves .html files and payloads from public/path/to/file
  • nuxi build / preview creates / serves equivalent mjs files under server/chunks etc
So I assume that "prerendering" in the build case is not physical html files but mjs files which Nitro / Vue can more efficiently present as HTML?

Thanks
Was this page helpful?