# ViteManifest

> Typed snapshot of the Vite bridge configuration and its build manifest.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Asset](/docs/extensions/debug-core/reference/panel/asset/index.md) › ViteManifest

| final readonly class | `PHPForge\Debug\Panel\Asset\ViteManifest` |
| --- | --- |
| Source | [`src/Panel/Asset/ViteManifest.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/Asset/ViteManifest.php#L14) |

Typed snapshot of the Vite bridge configuration and its build manifest.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-baseUrl"></span>`$baseUrl` readonly constructor | `string` | Public base URL the built assets are served from. | `ViteManifest` |
| <span id="property-chunks"></span>`$chunks` readonly constructor | `list<`[`ViteChunk`](/docs/extensions/debug-core/reference/panel/asset/vitechunk/index.md)`>` | Build chunks in the manifest. | `ViteManifest` |
| <span id="property-devMode"></span>`$devMode` readonly constructor | `bool` | Whether the bridge serves assets from the Vite dev server instead of the build manifest. | `ViteManifest` |
| <span id="property-devServerUrl"></span>`$devServerUrl` readonly constructor | `string\|null` | Dev server URL, or `null` when the bridge serves built assets. | `ViteManifest` |
| <span id="property-manifestPath"></span>`$manifestPath` readonly constructor | `string` | Filesystem path of the build manifest the bridge reads. | `ViteManifest` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates a Vite snapshot from bridge settings and build chunks. | `ViteManifest` |
| [`fromArray()`](#method-fromArray) static | Narrows the persisted Vite payload into a typed manifest. | `ViteManifest` |
| [`jsonSerialize()`](#method-jsonSerialize) | Returns the typed manifest for JSON serialization. | `ViteManifest` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(string $baseUrl, bool $devMode, string|null $devServerUrl, string $manifestPath, list<PHPForge\Debug\Panel\Asset\ViteChunk> $chunks)
```

Creates a Vite snapshot from bridge settings and build chunks.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$baseUrl` | `string` |  |
| `$devMode` | `bool` |  |
| `$devServerUrl` | `string\|null` |  |
| `$manifestPath` | `string` |  |
| `$chunks` | `list<`[`ViteChunk`](/docs/extensions/debug-core/reference/panel/asset/vitechunk/index.md)`>` | Build chunks in the manifest. |

### fromArray() <span id="method-fromArray"></span>

```php
public static function fromArray(mixed $data, string $path): self
```

Narrows the persisted Vite payload into a typed manifest.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `mixed` | Persisted manifest, expected to be an object carrying the declared shape. |
| `$path` | `string` | JSON path of the manifest, used to report a malformed payload. |

**Returns**

`self`: Manifest carrying the bridge configuration and its build chunks.

### jsonSerialize() <span id="method-jsonSerialize"></span>

```php
public function jsonSerialize(): array<string, mixed>
```

Returns the typed manifest for JSON serialization.

**Returns**

`array<string, mixed>`