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

Maintainers

Package info

github.com/php-forge/vite

pkg:composer/php-forge/vite

Transparency log

Fund package maintenance!

terabytesoftw

Statistics

Installs: 126

Dependents: 2

Suggesters: 0

Stars: 1

Open Issues: 0

dev-main / 0.1.x-dev 2026-08-22 22:05 UTC

This package is auto-updated.

Last update: 2026-08-22 22:37:18 UTC


README

PHP Forge

Vite


PHPUnit Mutation Testing Easy Coding Standard Dependency Check

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

Features

Feature overview

Installation

composer require php-forge/vite:^0.1

HTML output is generated with ui-awesome/html while asset resolution remains independent from its representation.

The consuming application owns Vite and every JavaScript dependency. Configure Vite to write a build manifest:

import {defineConfig} from 'vite';

export default defineConfig({
    build: {
        manifest: true,
    },
});

Quick start

Development

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

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

echo (new HtmlRenderer())->render($vite->resolve());

Production

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

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

echo (new HtmlRenderer())->render($vite->resolve());

Documentation

Package information

PHP Latest Stable Version Total Downloads

Code quality

Codecov PHPStan Level Max Quality Dependency Check

Social networks

Follow on X

License

License