1. Go to this page and download the library: Download phpsoftbox/vite library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phpsoftbox / vite example snippets
$vite = new \PhpSoftBox\Vite\Vite(
manifestPath: __DIR__ . '/public/build/manifest.json',
hotFile: __DIR__ . '/public/hot',
devServer: 'https://vite.domain.local',
environment: 'dev',
buildBase: '/build',
ssrUrl: 'http://node:13714/render',
ssrEntry: 'resources/js/ssr.tsx',
ssrTimeout: 2.0,
dev: null, // явный флаг dev-режима; null — определить по environment
);
echo $vite->tags('resources/js/app.tsx');