# Build artifacts

> What a build writes to disk, and which file goes to a generation endpoint.

Source: https://docxcelerate.com/docs/projects/artifacts/

Building a document writes plain JSON into `build.outDir` inside the document's own
directory — `documents/offer-of-admission/build/` with the default config.

```text
documents/offer-of-admission/build/
  manifest.json
  preview.json
  document.json
  derivers.js      (only when the document uses derivers)
```

## manifest.json

The index. It records what was built, when, and where the other files are:

```json
{
  "schemaVersion": "docxcelerate.project-manifest/v0",
  "id": "offer-of-admission",
  "name": "Offer of Admission",
  "version": "1.0.0",
  "title": "Offer of Admission",
  "entrypoint": "document.project.ts",
  "builtAt": "2026-08-13T09:15:00.000Z",
  "previewDocument": "preview.json",
  "engineDocument": "document.json",
  "style": { "...": "the project's DocumentStyle" }
}
```

`deriverNames` and `derivers` appear only when the document invokes derivers.

## preview.json

The document resolved against `previewData`, with dynamic nodes rendered to their
**placeholders**. This is your local development artifact — it's what the
preview app shows, and it never needs a service.

## document.json

The upload artifact. It's the same tree, except request-time values are kept as
tokens rather than baked in:

```json
{
  "kind": "paragraph",
  "mode": "static",
  "id": "greeting",
  "text": "Dear {{data.applicantName}},"
}
```

Dynamic nodes carry their prompts instead of text. This is the one you send to
[the engine](/docs/generation/endpoint/), which substitutes real data and
resolves the prompts.

> The distinction matters when you are debugging. If a document looks right in
> preview but wrong in production, compare `preview.json` and `document.json` —
> the difference is exactly the set of values that are resolved elsewhere.

## derivers.js

Derivers are named functions a node can invoke to compute a value before it
renders — a currency format, a date difference, a lookup. A node declares them:

```ts
{
  output: "monthsRemaining",
  name: "monthsBetween",
  inputs: [dataRef("startDate"), ctxRef("today")]
}
```

Because the endpoint resolves nodes remotely, the functions have to travel with
the document. `derivers.js` is that bundle, containing only the derivers the
document actually references. Documents that use none don't get the file.
