Skip to content
PHP Ecosystem
Explore

ViteChunk

API reference › Debug Core › Panel › Asset › ViteChunk

final readonly classPHPForge\Debug\Panel\Asset\ViteChunk
ImplementsPHPForge\Debug\Storage\PanelRow
Sourcesrc/Panel/Asset/ViteChunk.php

Typed entry of a Vite build manifest.

PropertyTypeDescriptionDefined by
$cssCount readonly constructorintNumber of CSS files attached to the chunk.ViteChunk
$file readonly constructorstringBuilt file emitted for the chunk.ViteChunk
$imports readonly constructorintNumber of chunks this one imports.ViteChunk
$isEntry readonly constructorboolWhether the chunk is a Vite entry point.ViteChunk
$name readonly constructorstringChunk name as keyed in the manifest.ViteChunk
MethodDescriptionDefined by
__construct()Creates a Vite manifest entry with its built file and asset counts.ViteChunk
fromArray() staticNarrows one persisted manifest entry into a typed chunk.ViteChunk
jsonSerialize()Returns the typed row for JSON serialization.ViteChunk
public function __construct(string $name, string $file, int $cssCount, int $imports, bool $isEntry)

Creates a Vite manifest entry with its built file and asset counts.

Parameters

ParameterTypeDescription
$namestring
$filestring
$cssCountint
$importsint
$isEntrybool
public static function fromArray(mixed $data, string $path): self

Narrows one persisted manifest entry into a typed chunk.

Parameters

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

Returns

self: Chunk carrying every persisted manifest field.

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

Returns the typed row for JSON serialization.

Returns

array<string, mixed>