ViteChunk
API reference › Debug Core › Panel › Asset › ViteChunk
Typed entry of a Vite build manifest.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$cssCount readonly constructor | int | Number of CSS files attached to the chunk. | ViteChunk |
$file readonly constructor | string | Built file emitted for the chunk. | ViteChunk |
$imports readonly constructor | int | Number of chunks this one imports. | ViteChunk |
$isEntry readonly constructor | bool | Whether the chunk is a Vite entry point. | ViteChunk |
$name readonly constructor | string | Chunk name as keyed in the manifest. | ViteChunk |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a Vite manifest entry with its built file and asset counts. | ViteChunk |
fromArray() static | Narrows one persisted manifest entry into a typed chunk. | ViteChunk |
jsonSerialize() | Returns the typed row for JSON serialization. | ViteChunk |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”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
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$file | string | |
$cssCount | int | |
$imports | int | |
$isEntry | bool |
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfNarrows one persisted manifest entry into a typed chunk.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Persisted manifest entry, expected to be an object carrying the declared shape. |
$path | string | JSON path of the entry, used to report a malformed payload. |
Returns
self: Chunk carrying every persisted manifest field.
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the typed row for JSON serialization.
Returns
array<string, mixed>