PHP code example of horizom / vite

1. Go to this page and download the library: Download horizom/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/ */

    

horizom / vite example snippets



use Horizom\Vite\Vite;

// Your entry point
$entry = 'resources/js/app.js';

$config = [
    
    /**
     * The build directory (default: 'public/dist')
     */
    'outputDir' => 'public/dist',

    /**
     * Force development mode (default: false)
     */
    'forceDev' => false,

    /**
     * The host (default: 'http://localhost:5173')
     */
    'host' => 'http://localhost:5173',

    /**
     * The manifest file (default: '.vite/manifest.json')
     */
    'manifest' => '.vite/manifest.json',

    /**
     * The base path (default: '')
     */
    'basePath' => '',
];

$plugin = new Vite($config);

// Render the html tags
$plugin->render($entry);