diff --git a/docs/1.getting-started/10.deployment.md b/docs/1.getting-started/10.deployment.md index da1aeb93bda1..b2cff5bf3d97 100644 --- a/docs/1.getting-started/10.deployment.md +++ b/docs/1.getting-started/10.deployment.md @@ -87,7 +87,19 @@ Use the [`nuxi generate` command](/docs/api/commands/generate) to build your app npx nuxi generate ``` -### Manual Pre-rendering +You can enable crawl-based pre-rendering when using `nuxt build` in the `nuxt.config` file: + +```ts [nuxt.config.ts|js] +defineNuxtConfig({ + nitro: { + prerender: { + crawlLinks: true + } + } +}) +``` + +### Selective Pre-rendering You can manually specify routes that [Nitro](/docs/guide/concepts/server-engine) will fetch and pre-render during the build. @@ -101,6 +113,20 @@ defineNuxtConfig({ }) ``` +When using this option with `nuxi build`, static payloads won't be generated by default at build time. For now, selective payload generation is under an experimental flag. + +```ts [nuxt.config.ts|js] +defineNuxtConfig({ + /* The /dynamic route won't be crawled */ + nitro: { + prerender: { crawlLinks: true, ignore: ['/dynamic'] } + }, + experimental: { + payloadExtraction: true + } +}) +``` + ### Client-side Only Rendering If you don't want to pre-render your routes, another way of using static hosting is to set the `ssr` property to `false` in the `nuxt.config` file. The `nuxi generate` command will then output an `.output/public/index.html` entrypoint and JavaScript bundles like a classic client-side Vue.js application.