PHP code example of themeplate / vite
1. Go to this page and download the library: Download themeplate/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/ */
themeplate / vite example snippets
use ThemePlate\Vite\Project;
$vite = new Project( get_stylesheet_directory(), get_stylesheet_directory_uri() );
// $vite->config->prefix( 'custom-' );
add_action( 'wp_enqueue_scripts', function() use ( $vite ) {
$vite->style( 'main-style' );
$vite->script( 'main-script' );
$vite->action();
} );
add_action( 'enqueue_block_editor_assets', function() use ( $vite ) {
$vite->style( 'editor-style' );
$vite->script( 'editor-script' );
$vite->action();
} );