Search by

Framework-agnostic PHP integration for Vite development servers and build manifests

Package info

github.com/php-forge/vite

pkg:composer/php-forge/vite

Fund package maintenance!

terabytesoftw

Statistics

Installs: 2 712

Dependents: 7

Suggesters: 0

Stars: 1

Open Issues: 0

0.3.0 2026-09-11 19:50 UTC

This package is auto-updated.

Last update: 2026-09-11 19:58:43 UTC


README

PHP Forge

Vite


PHPUnit Mutation Testing Easy Coding Standard Security

A framework-agnostic PHP integration for resolving Vite development and production assets.

Features

Feature overview

Installation

composer require php-forge/vite:^0.3

The consuming application owns Vite and every JavaScript dependency. Production resolution needs Vite's build manifest; see Installation for the vite.config.js settings and the resulting manifest path.

Quick start

Development

use PHPForge\Vite\Configuration\DevelopmentConfiguration;
use PHPForge\Vite\Html\HtmlRenderer;
use PHPForge\Vite\Vite;

$vite = Vite::create(
    DevelopmentConfiguration::create(
        devServerUrl: 'http://localhost:5173',
    ),
    entrypoints: ['resources/js/app.js'],
);

echo HtmlRenderer::create()->render($vite->resolve());

Production

use PHPForge\Vite\Configuration\ProductionConfiguration;
use PHPForge\Vite\Html\HtmlRenderer;
use PHPForge\Vite\Vite;

$vite = Vite::create(
    ProductionConfiguration::create(
        manifestPath: '/srv/app/public/build/.vite/manifest.json',
        assetBaseUrl: '/build',
    ),
    entrypoints: ['resources/js/app.js'],
);

echo HtmlRenderer::create()->render($vite->resolve());

Debugger integration

Vite::resolve() emits AssetsResolved through an optional PSR-14 dispatcher. The asset resolution path never imports a debug contract or calls a collector, so installing the package does not activate a debugger and a call without a dispatcher emits no events. The collector and panel that do implement those contracts live apart, in PHPForge\Vite\Debug, owned by this package.

See Debugger integration for the Yii2 and Yii3 wiring. It remains an unreleased prototype.

Yii2 Vite panel in Yii2
Yii3 Vite panel in Yii3

Documentation

Package information

PHP Latest Stable Version Total Downloads

Code quality

Codecov PHPStan Level Max Quality StyleCI

Social networks

Follow on X

License

License