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

# Build Executor

> Compile a FrontMCP project using frontmcp build

Builds a FrontMCP project by running `frontmcp build` from the project root. The `node` target produces a bundled server; other targets (`vercel`, `lambda`, `cloudflare`) compile with `tsc` and bundle the result. Code imported through tsconfig path aliases (for example `@my-org/shared` from a workspace library) is resolved and bundled for every target.

<Note>
  The executor runs the `frontmcp` CLI installed in your workspace (`node_modules/.bin/frontmcp`) and never downloads
  one with `npx`. Install it with `nx add @frontmcp/nx` or `npm install -D frontmcp`.
</Note>

## Usage

```bash theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
nx build my-app
```

## Configuration

```json project.json theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
{
  "targets": {
    "build": {
      "executor": "@frontmcp/nx:build",
      "outputs": ["{projectRoot}/dist"],
      "options": {
        "entry": "{projectRoot}/src/main.ts",
        "outputPath": "{projectRoot}/dist"
      }
    }
  }
}
```

## Options

| Option | Type | Description |
| - | - | - |
| `entry` | `string` | Entry file path |
| `outputPath` | `string` | Output directory path |
| `target` | `node` \| `vercel` \| `lambda` \| `cloudflare` | Deployment target (passed to `frontmcp build --target`) |
| `adapter` | same as `target` | Deprecated alias of `target`; `target` wins when both given |

## Caching

This executor is **cacheable**. Projects generated by `@frontmcp/nx` set `"cache": true` on the `build` target, and `nx add @frontmcp/nx` (the `init` generator) registers the same for `@frontmcp/nx:build` and `@frontmcp/nx:build-exec` in `nx.json` `targetDefaults`. Nx skips the build if inputs haven't changed.

```json nx.json theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
{
  "targetDefaults": {
    "build": {
      "cache": true,
      "dependsOn": ["^build"],
      "inputs": ["production", "^production"]
    }
  }
}
```


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