--- title: "nuxt 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/packages/nuxi/src/commands/generate.ts size: xs --- ```bash [Terminal] npx nuxt generate [ROOTDIR] [--cwd=] [--logLevel=] [--preset] [--dotenv] [--envName] [-e, --extends=] [--profile[=verbose]] ``` 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 `nuxt build` command with the `prerender` argument set to `true` ## Arguments | Argument | Description | |---------------|------------------------------------------------| | `ROOTDIR="."` | Specifies the working directory (default: `.`) | ## Options | Option | Default | Description | |--------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------| | `--cwd=` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) | | `--logLevel=` | | Specify build-time log level | | `--preset` | | Nitro server preset | | `--dotenv` | | Path to `.env` file to load, relative to the root directory | | `--envName` | | The environment to use when resolving configuration overrides (default is `production` when building, and `development` when running the dev server) | | `-e, --extends=` | | Extend from a Nuxt layer | | `--profile` | | Profile performance (v4.4+). Writes a V8 CPU profile and JSON report on exit. Use `--profile=verbose` for a full console report. | ::read-more{to="/docs/4.x/getting-started/deployment#static-hosting"} Read more about pre-rendering and static hosting. ::