# Build pipeline options

The keys that shape how imports are resolved, loaded and written, and how `hamur dev` hot-updates. Each is in [`HamurConfig`](/api-reference/hamur) with its checks and error messages; this page lists them with their defaults and says where to read more.

| Key                           | Type                                                        | Default   | What it does                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------------------- | ----------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `build.assetsInclude`         | `string[]`                                                  | `[]`      | extensions, lower case, without a dot, that an import turns into an asset URL in both bundles, besides the built-in asset extensions ([Assets](/directory-structure#assets))                                                                                                                                                                                                                  |
| `build.assetsInlineLimit`     | `number`                                                    | `4096`    | bytes up to which a file that a stylesheet loads with `url()` stays inline; `0` emits every file                                                                                                                                                                                                                                                                                              |
| `build.chunkSizeWarningLimit` | `number`                                                    | `500`     | KiB of minified JS; `hamur build` names each client chunk above it, with its two largest packages, after the output table; `0` is off                                                                                                                                                                                                                                                         |
| `build.minChunkSize`          | `number`                                                    | `0`       | bytes; Bun folds a shared client chunk smaller than this into its importers (`16384` is a good value)                                                                                                                                                                                                                                                                                         |
| `build.hashSalt`              | `string`                                                    | `""`      | a string mixed into the content hash of every client JS and CSS file, which are named `<16 hex>.js` and `<16 hex>.css`; changing it renames them all and no image, font or other asset                                                                                                                                                                                                        |
| `build.clientBundle`          | `"split" \| "single" \| "inline"`                           | `"split"` | `"single"` writes one client JS file and one CSS file, every route in the one file and no import map; `"inline"` (with `ssr: false` and a static preset) writes the JS and CSS into `index.html`, every imported file and CSS `url()` a `data:` URI, so the page opens from `file://` under `app.history: "hash"`                                                                             |
| `build.license`               | `boolean \| { fileName?: string; includeServer?: boolean }` | `false`   | writes a third-party license file of the packages in the client build (and the server's with `includeServer`): `true` writes `.output/.hamur-license.md`, which is not served; `fileName: "licenses.json"` writes `public/licenses.json` as `[{ name, version, identifier, text }]`, any other extension writes Markdown; a package without a license file has `text: ""` and the build warns |
| `build.inlineStyles`          | `number`                                                    | `0`       | bytes up to which a stylesheet of a page's first render is written into the document as `<style data-hamur-href>` instead of a link; `0` is off                                                                                                                                                                                                                                               |
| `build.conditions`            | `{ client?: string[]; server?: string[] }`                  | `{}`      | package `exports` conditions appended after Hamur's own: `client` for the client, worker and dev client builds, `server` for the server and dev server builds                                                                                                                                                                                                                                 |
| `build.dedupe`                | `string[]`                                                  | `[]`      | packages that resolve to the copy at the app root in every build and both dev bundlers, so a linked package cannot bring a second copy                                                                                                                                                                                                                                                        |
| `build.features`              | `string[]`                                                  | `[]`      | the flags that `feature("X")` from `bun:bundle` turns into `true`; every other flag is `false` and its branch is removed                                                                                                                                                                                                                                                                      |
| `build.drop`                  | `{ client?: string[]; server?: string[] }`                  | `{}`      | what Bun removes from production builds: `"debugger"`, or a name or member path such as `"console"` or `"console.log"`; `hamur dev` keeps every call                                                                                                                                                                                                                                          |
| `build.optimizeImports`       | `string[]`                                                  | `[]`      | packages whose barrel files Bun parses lazily; Bun does it already for a package that sets `"sideEffects": false`                                                                                                                                                                                                                                                                             |
| `build.worker.plugins`        | `BunPlugin[]`                                               | `[]`      | Bun plugins that join each worker build after the client's plugins ([Web workers](/directory-structure#web-workers))                                                                                                                                                                                                                                                                          |
| `build.plugins`               | `BunPlugin[]`                                               | `[]`      | Bun plugins for every build ([Bun plugins in Hamur](/bun-plugins))                                                                                                                                                                                                                                                                                                                            |
| `devServer.hmr`               | `boolean`                                                   | `true`    | `false` turns off Bun's hot module replacement in `hamur dev`: every change to a file the browser loads reloads the page ([HMR in app code](/hmr-in-app-code))                                                                                                                                                                                                                                |

An entry of the wrong type fails when the config loads, with a message such as `build.dedupe entries are package names (got "./zustand")`; the messages are in the [reference](/api-reference/hamur).

## Conditions

`build.conditions.client` reaches the dev client only through the packages that sit directly under the app's `node_modules` (scoped ones included) and whose `exports` name one of the conditions, since Bun's dev bundler takes no `conditions` option. A package found deeper in the tree resolves without them; `hamur dev --debug` lists the packages that are covered. `hamur typegen` sets `customConditions` of the app tsconfig to the `client` list and of the server one to the `server` list, so `tsc` picks the same exports.

## Features

```ts
import { feature } from "bun:bundle"

if (feature("BETA")) renderBeta()
```

With `build.features: ["BETA"]` the call is `true` in every build and in `hamur dev`; without it the call is `false` and the branch is gone from the output. `bun:bundle` is allowed in client code, and its call takes one string literal: `feature() takes one string literal, the name of a flag (got feature(name))`. `hamur typegen` writes the flags as the `Registry` of `bun:bundle`, so a misspelt flag is a type error. In `hamur dev` the client has no Bun option for it, so Hamur folds the call in its own transform; a module that does not import `bun:bundle` is untouched.

## Drop

A client drop of `console` also removes Hamur's own client warnings. `build.drop.server` may not name `console`, `console.log`, `console.warn` or `console.error`, since the server logger writes through them; drop `console.debug` or set `server.logLevel`. Bun drops the arguments of a dropped call too, side effects included.

## Tests

- `build.assetsInclude` and the has-no-loader error: `packages/hamur/src/build/assets.test.ts`, `packages/hamur/src/config/validate.test.ts`.
- `build.dedupe`, `build.conditions` and `build.features` in a build: `packages/hamur/src/build/resolution.test.ts`; in `hamur dev`: `tests/dev-resolution.test.ts`; the dev fold of `feature()`: `packages/hamur/src/build/features.test.ts`.
- `build.drop`, on the client only, on the server only, and the server refusal: `packages/hamur/src/build/resolution.test.ts`.
- `build.optimizeImports`, a barrel of 2000 exports parsed with and without the key: `packages/hamur/src/build/resolution.test.ts`; the dev client keeps one `lucide-react` icon: `tests/dev-optimize-imports.test.ts`.
- `devServer.hmr: false` reloads the page: `tests/browser/hmr-off.test.ts`; the key's check: `packages/hamur/src/config/validate.test.ts`.
