Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use nuxt generate when you want Nuxt to prerender routes into static files for a static host or CDN. Use nuxt build when your deployment needs a runtime server or a specific Nitro deployment preset. In Nuxt 4, generate is build behavior with prerendering enabled; the key difference is the output and runtime your deployment needs.

What each command does

nuxt generate: build and prerender for static hosting

Nuxt’s prerendering guide describes nuxt generate as building and prerendering the application with Nitro’s crawler. The result includes HTML and payload assets under .output/public, which you can deploy as static files. No Nuxt server is included to handle requests at runtime.

The crawler starts with the root route, non-dynamic page routes, and routes configured for prerendering, then follows links it discovers. That means a dynamic URL that is never linked from a discovered page may not be generated automatically. Add important routes explicitly rather than assuming every possible URL will be found.

nuxt build: build for a Nitro deployment preset

nuxt build creates output for the configured Nitro preset. The preset determines the target environment: it might be a Node.js server, serverless deployment, edge environment, or another supported platform. With the Node server preset, Nuxt documents .output/server/index.mjs as the production entry point to run with Node. See the Nuxt deployment guide for deployment-specific instructions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Plain nuxt build does not mean “make a static site” in every configuration. Its result depends on the preset and build configuration.

nuxt build --prerender: prerender through the build command

Nuxt documents nuxt build --prerender as equivalent to the static prerendering behavior of nuxt generate. Choose it if you prefer to express the build as a build command with prerendering enabled.

Choose by deployment requirement

What you need Command or configuration Why
Static files hosted by a static file service or CDN nuxt generate or nuxt build --prerender Routes are rendered at build time into static output. Confirm that every required route is included.
Runtime behavior, such as server endpoints nuxt build with a server-capable Nitro preset The deployment includes a runtime server; a static prerender output does not.
Serverless or edge deployment nuxt build with the appropriate Nitro target The build output must match the provider’s runtime and deployment requirements.
Client-only SPA on static hosting Configure ssr: false and follow Nuxt’s static deployment guidance This produces an entry page and JavaScript bundles rather than prerendered HTML for each route. Nuxt notes the SEO tradeoff compared with prerendering.

Nuxt supports deployment to Node.js servers, static hosting, and serverless or edge environments; those are different deployment models, not interchangeable output formats. The deployment documentation for your chosen provider and Nitro preset determines the exact setup.

How prerendering discovers routes—and what it can miss

Prerendering is useful only for the URLs that make it into the build. Nitro’s crawler follows links it discovers from its starting routes. A URL may be missed if it is dynamic, absent from discoverable links, or otherwise not part of the configured prerender set.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For Nuxt 4, configure route lists and exclusions through nitro.prerender. Explicitly include important routes that the crawler cannot reach through links. Then inspect the generated output and verify that the expected HTML exists before deploying.

For example, a site with pages such as /products/alpha and /products/beta should not rely on automatic discovery if those paths are not linked from pages the crawler visits. Configure the routes as required by your Nuxt setup, then verify the resulting files in .output/public. The precise route configuration belongs in your Nuxt configuration; consult the version-matched prerendering documentation for syntax and options.

Static hosting needs the right fallback behavior

Nuxt says nuxt generate and nuxt build --prerender create 200.html and 404.html fallbacks. Hosting platforms differ in how they expect these files to be used: some require rewrite rules or a configured fallback document. Check the selected host’s routing instructions, especially for direct visits to nested paths and unknown URLs.

  • Open a prerendered nested URL directly, not only by navigating to it from the home page.
  • Check that an unknown path reaches the intended not-found behavior.
  • Confirm the host is serving the generated directory and applying its documented fallback or rewrite rules.

A static build can contain the right page files yet still behave incorrectly if the host routes requests to them improperly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Commands and deployment checks

  1. For static prerendering: run npx nuxt generate, or use npx nuxt build --prerender.
  2. Inspect the artifact: confirm .output/public contains the expected generated pages and assets.
  3. Deploy static output: publish the generated public directory using the static host’s Nuxt instructions, including its fallback configuration.
  4. For a runtime deployment: configure the Nitro preset for the target, run npx nuxt build, then follow the preset or provider instructions. For the Node preset, the documented entry point is .output/server/index.mjs.
  5. Test production behavior: check direct navigation, server endpoints if applicable, and any routes that should be prerendered.

These commands use the Nuxt CLI through npx; use the project’s installed Nuxt version and package-manager conventions. The documented output and configuration are version-sensitive, so do not copy a Nuxt 3 configuration into a Nuxt 4 project without checking the migration guidance.

Nuxt 4 and Nuxt 3 configuration differences

This guidance is primarily for Nuxt 4. In Nuxt 4, use nitro.prerender for prerender route configuration. The Nuxt upgrade guide says the older top-level generate configuration option was removed; that is a configuration change and should not be confused with whether the nuxt generate command exists.

Nuxt’s current documentation identifies Nuxt 3 as having reached end of life on July 31, 2026. For new projects, use the current Nuxt 4 documentation. If you maintain a Nuxt 3 application, check the documentation corresponding to that version and the Nuxt upgrade guide before changing configuration.

Performance, SEO, reliability, and cost trade-offs

Prerendering moves page rendering to build time and lets a static host serve generated files. Nuxt describes prerendering as a way to improve certain performance or SEO metrics, but its official materials cited here do not quantify a speed increase or ranking effect. Actual results depend on the application, hosting, route coverage, and content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Static output removes the need for a Nuxt runtime server for those generated pages, but it also means runtime server behavior is not available from that artifact. A runtime deployment can support server behavior, but requires a compatible server, serverless, or edge target. No general cost or performance winner follows from the command names alone; compare the needs and pricing of the deployment services you intend to use.

Troubleshooting common mistakes

A page works through navigation but fails on direct load

Check the static host’s rewrite and fallback configuration, then test the nested URL directly. Confirm that the route was generated and that the host is serving .output/public as intended.

A dynamic route is absent from the static output

The crawler may not have discovered it. Add the URL to Nuxt 4’s prerender configuration using nitro.prerender, rebuild, and verify the corresponding output file.

Server endpoints are unavailable after deployment

A static prerendered directory does not include a running Nuxt server. If the app requires runtime endpoints, use nuxt build with a suitable server-capable preset and deploy according to that target’s instructions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The expected Node entry point is missing

Check that the build used the Node server preset. The documented Node entry point is .output/server/index.mjs; another Nitro preset produces output for a different environment.

An older config option no longer works

If migrating to Nuxt 4, check whether the project still uses the removed top-level generate configuration option. Follow the current Nuxt 4 prerender configuration documentation and use nitro.prerender for routes and exclusions.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you also need screenshots of deployed pages—for a visual review, a record of a release, or another capture workflow—you can use ScreenshotNeo, a website screenshot API and MCP server. One GET request returns an image or PDF. For example, this cURL call saves a WebP screenshot:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

See the ScreenshotNeo API documentation for options and response details. Cookie banners are accepted before capture and more than 60 known consent platforms, newsletter popups, and chat widgets are removed; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently Asked Questions

Does nuxt generate compile the application?

Yes. In Nuxt 4 it triggers build behavior with prerendering enabled; it is not a separate compilation system.

Does nuxt generate prerender every possible URL?

No. The crawler discovers routes from its starting pages and links, while routes it cannot reach should be configured explicitly.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I use nuxt build --prerender instead of nuxt generate?

Yes. Nuxt documents its static prerendering behavior as equivalent.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.