2022-10-06 09:15:30 +00:00
|
|
|
---
|
|
|
|
title: "nuxi build"
|
|
|
|
description: "Build your Nuxt application."
|
|
|
|
---
|
|
|
|
|
2022-04-06 05:56:08 +00:00
|
|
|
# `nuxi build`
|
|
|
|
|
|
|
|
```{bash}
|
2022-09-26 10:36:10 +00:00
|
|
|
npx nuxi build [rootDir] [--prerender] [--dotenv]
|
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.
|
|
|
|
|
|
|
|
Option | Default | Description
|
|
|
|
-------------------------|-----------------|------------------
|
|
|
|
`rootDir` | `.` | The root directory of the application to bundle.
|
2022-09-26 10:36:10 +00:00
|
|
|
`--prerender` | `false` | Pre-render every route of your application. (**note:** This is an experimental flag. The behavior might be changed.)
|
|
|
|
`--dotenv` | `.` | Point to another `.env` file to load, **relative** to the root directory.
|
2022-04-06 05:56:08 +00:00
|
|
|
|
2022-07-06 18:39:02 +00:00
|
|
|
This command sets `process.env.NODE_ENV` to `production`.
|