--- title: "nuxt build" description: "Build your Nuxt application." links: - label: Source icon: i-simple-icons-github to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/build.ts size: xs --- ```bash [Terminal] npx nuxt build [ROOTDIR] [--cwd=] [--logLevel=] [--prerender] [--preset] [--dotenv] [--envName] [-e, --extends=] [--profile[=verbose]] ``` The `build` command creates a `.output` directory with all your application, server and dependencies ready for production. ## 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 | | `--prerender` | | Build Nuxt and prerender static routes | | `--preset=` | | Specify Nitro server preset. Available presets depend on Nitro (e.g. `node-server`, `vercel`, `netlify`, `static`) | | `--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. | ::note This command sets `process.env.NODE_ENV` to `production`. :: ::note `--prerender` will always set the `preset` to `static` ::