> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nanoforge.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# build

> Build your NanoForge project for production

## Overview

`nf build` compiles your NanoForge project. The client and server entry points, static directories,
and output directories all default to the values in your
[configuration file](https://docs.nanoforge.eu/docs/cli/configuration/configuration-file.md) and can be overridden per run.

When the workspace sets `network: "p2p"`, each server app is also built for the browser, into the
client's output directory under `server/`, so the host player's tab can run it.

## Usage

```bash theme={null}
nf build
```

## Options

| Option | Description |
| - | - |
| `-d, --directory <directory>` | Working directory of the command. |
| `-c, --config <config>` | Path to the configuration file. |
| `--client-entry <clientEntry>` | Entry file of the client. |
| `--server-entry <serverEntry>` | Entry file of the server. |
| `--client-static-dir <clientStaticDir>` | Static directory of the client. |
| `--server-static-dir <serverStaticDir>` | Static directory of the server. |
| `--client-out-dir <clientOutDir>` | Output directory of the client. |
| `--server-out-dir <serverOutDir>` | Output directory of the server. |
| `--editor` | Build with the editor configuration. |
| `--watch` | Build in watch mode. Default: `false`. |

## Examples

**Build using the configuration defaults:**

```bash theme={null}
nf build
```

**Rebuild on change with a custom client output directory:**

```bash theme={null}
nf build --watch --client-out-dir dist/client
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.