2022-10-06 09:15:30 +00:00
---
title: "nuxi generate"
description: Pre-renders every route of the application and stores the result in plain HTML files.
2023-10-18 10:59:43 +00:00
links:
- label: Source
icon: i-simple-icons-github
to: https://github.com/nuxt/cli/blob/main/src/commands/generate.ts
size: xs
2022-10-06 09:15:30 +00:00
---
2023-10-18 10:59:43 +00:00
```bash [Terminal]
2023-01-09 09:25:24 +00:00
npx nuxi generate [rootDir] [--dotenv]
2022-04-20 17:54:40 +00:00
```
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
2023-01-09 09:25:24 +00:00
`--dotenv` | `.` | Point to another `.env` file to load, **relative** to the root directory.
2023-08-03 16:04:30 +00:00
2023-10-18 10:59:43 +00:00
::read-more{to="/docs/getting-started/deployment#static-hosting"}
Read more about pre-rendering and static hosting.
2023-08-03 16:04:30 +00:00
::