PHPackages                             idleberg/vite-manifest - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. idleberg/vite-manifest

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

idleberg/vite-manifest
======================

A parser for Vite manifest files

v2.0.0(4mo ago)2161.0k↓24.6%23MITPHPPHP &gt;=8.2CI passing

Since Feb 19Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/idleberg/php-vite-manifest)[ Packagist](https://packagist.org/packages/idleberg/vite-manifest)[ Fund](https://www.buymeacoffee.com/idleberg)[ RSS](/packages/idleberg-vite-manifest/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (28)Used By (3)

Vite Manifest
=============

[](#vite-manifest)

> A parser for [Vite](https://vitejs.dev/) manifest files.

[![License](https://camo.githubusercontent.com/825a86c692d98da5569b69436f4cc04f815c4c577472e90607a42167dfb1e20e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f69646c65626572672f766974652d6d616e69666573743f7374796c653d666f722d7468652d626164676526636f6c6f723d626c7565)](https://github.com/idleberg/php-vite-manifest/blob/main/LICENSE)[![Version](https://camo.githubusercontent.com/d7711485b0a15d3758c40fe084f2f66b403967894400f6ae7343230c4dd63512/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69646c65626572672f766974652d6d616e69666573743f7374796c653d666f722d7468652d6261646765)](https://github.com/idleberg/php-vite-manifest/releases)[![PHP Version](https://camo.githubusercontent.com/8f567089a65982ff86d253a994ccae03cf8fe355928ab5b9aa6bb929c75e01ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f69646c65626572672f766974652d6d616e69666573742f7068703f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/8f567089a65982ff86d253a994ccae03cf8fe355928ab5b9aa6bb929c75e01ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f69646c65626572672f766974652d6d616e69666573742f7068703f7374796c653d666f722d7468652d6261646765)[![Build](https://camo.githubusercontent.com/b937d35fdd28a56b5470be44e80e18b6da6ed2b9bd5abf278890f36484f3f5a4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f69646c65626572672f7068702d766974652d6d616e69666573742f64656661756c742e796d6c3f7374796c653d666f722d7468652d6261646765)](https://github.com/idleberg/php-vite-manifest/actions)

**Table of contents**

- [Installation](#installation)
- [Usage](#usage)
- [Methods](#methods)
    - [`getManifest()`](#getmanifest)
    - [`getEntrypoint()`](#getentrypoint)
    - [`getEntrypoints()`](#getentrypoints)
    - [`getImports()`](#getimports)
    - [`getStyles()`](#getstyles)
- [License](#license)

Installation
------------

[](#installation)

`composer require idleberg/vite-manifest`

Usage
-----

[](#usage)

To get you going, first instantiate the class exposed by this library.

```
new Manifest(string $manifestPath, string $baseUri, string $algorithm = "sha256");
```

### Parameters

[](#parameters)

#### `$manifestPath`

[](#manifestpath)

Type: `string`

Specifies the path to the manifest.

#### `$baseUri`

[](#baseuri)

Type: `string`

Specifies the base URI for the assets in the manifest.

#### `$algorithm`

[](#algorithm)

Type: `"sha256"` |`"sha384"` |`"sha512"` | `":manifest:"`
Default: `"sha256"`

Specifies the algorithm used for hashing the assets. This will be used for [subresource integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)when printing script or style tags.

Tip

You can use `":manifest:"` in conjunction with [vite-plugin-manifest-sri](https://github.com/ElMassimo/vite-plugin-manifest-sri), a plug-in that calculates the hashes at build-time and adds them to the manifest.

**Example**

```
use Idleberg\ViteManifest\Manifest;

$baseUrl = "https://idleberg.github.io";
$manifest = "path/to/manifest.json";

$vm = new Manifest($manifest, $baseUrl);
```

### Methods

[](#methods)

#### `getManifest()`

[](#getmanifest)

Usage: `getManifest()`

Returns the contents of the manifest file as a PHP array.

#### `getEntrypoint()`

[](#getentrypoint)

Usage: `getEntrypoint(string $entrypoint, bool $hash = true)`

Returns a specific entrypoint from the manifest.

**Example**

```
$entrypoint = $vm->getEntrypoint("index.ts");

if ($entrypoint) {
    ["url" => $url, "hash" => $hash] = $entrypoint;
    echo "" . PHP_EOL;
}
```

#### `getEntrypoints()`

[](#getentrypoints)

Usage: `getEntrypoints()`

Returns all entrypoints from the manifest.

#### `getImports()`

[](#getimports)

Usage: `getImports(string $entrypoint, bool $hash = true)`

Returns imports for a file listed in the manifest.

**Example**

```
foreach ($vm->getImports("index.ts", false) as $import) {
    ["url" => $url] = $import;
    echo "" . PHP_EOL;
}
```

#### `getStyles()`

[](#getstyles)

Usage: `getStyles(string $entrypoint, bool $hash = true)`

Returns stylesheets for a file listed in the manifest.

**Example**

```
foreach ($vm->getStyles("index.ts") as $style) {
    ["url" => $url, "hash" => $hash] = $style;
    echo "" . PHP_EOL;
}
```

License
-------

[](#license)

This work is licensed under [The MIT License](LICENSE).

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance76

Regular maintenance activity

Popularity39

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 98.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~59 days

Recently: every ~111 days

Total

25

Last Release

128d ago

Major Versions

v0.10.0 → v1.0.02023-11-23

v1.2.3 → v2.0.02026-01-10

PHP version history (6 changes)v0.1.1PHP &gt;=7.0.0

v0.4.0PHP ^7.3 || ^8.0

v0.5.0PHP ^7.4 || ^8.0

v0.8.0PHP &gt;=8.0

v1.0.0PHP &gt;=8.1

v2.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8ff89e309c7de4705011518a7ade125b6bec52b8f5a3fd55c785d0b3ba3ecc3?d=identicon)[idleberg](/maintainers/idleberg)

---

Top Contributors

[![idleberg](https://avatars.githubusercontent.com/u/1504938?v=4)](https://github.com/idleberg "idleberg (177 commits)")[![dst-jan](https://avatars.githubusercontent.com/u/217981129?v=4)](https://github.com/dst-jan "dst-jan (1 commits)")[![idflood](https://avatars.githubusercontent.com/u/197418?v=4)](https://github.com/idflood "idflood (1 commits)")

---

Tags

manifest-jsonvitevitejsvitevitejsvite manifest

###  Code Quality

TestsCodeception

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/idleberg-vite-manifest/health.svg)

```
[![Health](https://phpackages.com/badges/idleberg-vite-manifest/health.svg)](https://phpackages.com/packages/idleberg-vite-manifest)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
