mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-26 06:07:15 +00:00
f26a801775
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel Roe <daniel@roe.dev>
25 lines
978 B
Markdown
25 lines
978 B
Markdown
---
|
|
title: "nuxi generate"
|
|
description: Pre-renders every route of the application and stores the result in plain HTML files.
|
|
links:
|
|
- label: Source
|
|
icon: i-simple-icons-github
|
|
to: https://github.com/nuxt/cli/blob/main/src/commands/generate.ts
|
|
size: xs
|
|
---
|
|
|
|
```bash [Terminal]
|
|
npx nuxi generate [rootDir] [--dotenv]
|
|
```
|
|
|
|
The `generate` command pre-renders every route of your application and stores the result in plain HTML files that you can deploy on any static hosting services. The command triggers the `nuxi build` command with the `prerender` argument set to `true`
|
|
|
|
Option | Default | Description
|
|
-------------------------|-----------------|------------------
|
|
`rootDir` | `.` | The root directory of the application to generate
|
|
`--dotenv` | `.` | Point to another `.env` file to load, **relative** to the root directory.
|
|
|
|
::read-more{to="/docs/getting-started/deployment#static-hosting"}
|
|
Read more about pre-rendering and static hosting.
|
|
::
|