---
title: "createAssetManifest"
description: "Converts a bundler's normalized output into the manifest `createAssetResolver` reads."
url: "https://pitlane.tools/package/assets/build/function/createAssetManifest"
---

# createAssetManifest

```ts
import { createAssetManifest } from "@pitlane/assets/build";
```

```ts
function createAssetManifest(build): BuildAssetsManifest;
```

Converts a bundler's normalized output into the manifest `createAssetResolver` reads.

It walks each environment's static chunk graph to record, for every source module, its `modulepreload` URLs (its chunk first, then dependencies shallowest first) and stylesheets (a dependency's before its importer's). Dynamic imports are validated and never followed. It reads no files, invents no edges, and generates no import map; `serverEnvironment` is left for the integration to set per server.

## Parameters

### build

[`AssetBuild`](https://pitlane.tools/package/assets/build/interface/AssetBuild.md)

## Returns

[`BuildAssetsManifest`](https://pitlane.tools/package/assets/interface/BuildAssetsManifest.md)

## Throws

When there is not exactly one client environment, an edge or entry names a missing chunk, a chunk lacks one of its lists, a server environment lists entries, a source key is an absolute file URL, or one source key maps to two URLs.
