2022-10-06 09:15:30 +00:00
---
title: "nuxi build"
description: "Build your Nuxt application."
2023-10-18 10:59:43 +00:00
links:
- label: Source
icon: i-simple-icons-github
2025-01-16 23:58:26 +00:00
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/build.ts
2023-10-18 10:59:43 +00:00
size: xs
2022-10-06 09:15:30 +00:00
---
2024-12-18 10:29:56 +00:00
<!-- build - cmd -->
2023-10-18 10:59:43 +00:00
```bash [Terminal]
2024-12-18 10:29:56 +00:00
npx nuxi build [ROOTDIR] [--cwd=< directory > ] [--logLevel=< silent | info | verbose > ] [--prerender] [--preset] [--dotenv] [--envName]
2022-04-06 05:56:08 +00:00
```
2024-12-18 10:29:56 +00:00
<!-- /build - cmd -->
2022-04-06 05:56:08 +00:00
The `build` command creates a `.output` directory with all your application, server and dependencies ready for production.
2024-12-18 10:29:56 +00:00
## Arguments
<!-- build - args -->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.` )
<!-- /build - args -->
## Options
<!-- build - opts -->
Option | Default | Description
--- | --- | ---
`--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.` )
`--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--prerender` | | Build Nuxt and prerender static routes
`--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)
<!-- /build - opts -->
2022-04-06 05:56:08 +00:00
2024-02-21 17:09:45 +00:00
::note
2022-07-06 18:39:02 +00:00
This command sets `process.env.NODE_ENV` to `production` .
2023-10-18 10:59:43 +00:00
::
2024-04-12 22:06:12 +00:00
::note
`--prerender` will always set the `preset` to `static`
::