Skip to content
PHP Ecosystem
Explore

ViteManifest

API reference › Debug Core › Panel › Asset › ViteManifest

final readonly classPHPForge\Debug\Panel\Asset\ViteManifest
Sourcesrc/Panel/Asset/ViteManifest.php

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

PropertyTypeDescriptionDefined by
$baseUrl readonly constructorstringPublic base URL the built assets are served from.ViteManifest
$chunks readonly constructorlist<ViteChunk>Build chunks in the manifest.ViteManifest
$devMode readonly constructorboolWhether the bridge serves assets from the Vite dev server instead of the build manifest.ViteManifest
$devServerUrl readonly constructorstring|nullDev server URL, or null when the bridge serves built assets.ViteManifest
$manifestPath readonly constructorstringFilesystem path of the build manifest the bridge reads.ViteManifest
MethodDescriptionDefined by
__construct()Creates a Vite snapshot from bridge settings and build chunks.ViteManifest
fromArray() staticNarrows the persisted Vite payload into a typed manifest.ViteManifest
jsonSerialize()Returns the typed manifest for JSON serialization.ViteManifest
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

ParameterTypeDescription
$baseUrlstring
$devModebool
$devServerUrlstring|null
$manifestPathstring
$chunkslist<ViteChunk>Build chunks in the manifest.
public static function fromArray(mixed $data, string $path): self

Narrows the persisted Vite payload into a typed manifest.

Parameters

ParameterTypeDescription
$datamixedPersisted manifest, expected to be an object carrying the declared shape.
$pathstringJSON path of the manifest, used to report a malformed payload.

Returns

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

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

Returns the typed manifest for JSON serialization.

Returns

array<string, mixed>