Skip to content

Commit

Permalink
docs: selective pre-rendering options (nuxt#20670)
Browse files Browse the repository at this point in the history
  • Loading branch information
clemcode authored May 4, 2023
1 parent 47591c9 commit 30132f3
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/1.getting-started/10.deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand Down

0 comments on commit 30132f3

Please sign in to comment.