PHP code example of uupvite / vite-assets-loader
1. Go to this page and download the library: Download uupvite/vite-assets-loader 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/ */
uupvite / vite-assets-loader example snippets
$asset_loader = new \UupVite\ViteAssetsLoader(
__DIR__ . '/dist/manifest.json',
get_template_directory_uri() . '/dist/manifest.json'
);
$asset_loader->enqueue_script(
'theme-js', // handle
'js/main.js' // source file
);
$asset_loader->enqueue_style(
'theme-styles', // handle
'resources/css/theme.scss' // source file
);