php-forge / vite
Framework-agnostic PHP integration for Vite development servers and build manifests
Fund package maintenance!
dev-main / 0.1.x-dev
2026-08-22 22:05 UTC
Requires
- php: >=8.3
- ui-awesome/html: ^0.6
Requires (Dev)
- infection/infection: ^0.34
- maglnet/composer-require-checker: ^4.1
- php-forge/coding-standard: ^0.3
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.2
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0.3
- phpunit/phpunit: ^12.5
This package is auto-updated.
Last update: 2026-08-22 22:37:18 UTC
README
Vite
A framework-agnostic PHP integration for resolving Vite development and production assets.
Features
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
- Installation guide
- Configuration reference
- Manifest resolution
- Usage examples
- Security and CSP
- Testing guide