PHP code example of mrottow / vite-wordpress

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

    

mrottow / vite-wordpress example snippets


    

(new ViteWordPress\DevServer())->register();

(new ViteWordPress\DevServer())
    ->set_server_port(5173)
    ->set_server_host('localhost')
    ->register();


use ViteWordPress\DevServer;
use ViteWordPress\Manifest;

$manifest = Manifest::create( 'absolute/path/to/manifest.json' ); // Also works with a PHP manifest file.

// When using the dev server you need to eet_directory() . "build/{$file_name}" );
} );


use ViteWordPress\DevServer;
use ViteWordPress\ManifestResolver;

function manifest() {
	static $manifest;

	if ( ! isset( $manifest ) ) {
		$manifest = new ManifestResolver();
		$manifest->set_manifest( 'absolute/path/manifest.json' ); // Also works with a PHP manifest file.
	}

	return $manifest;
}

// When using the dev server you need to