PHP code example of tilpark / webpack-loader

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

    

tilpark / webpack-loader example snippets


use Tilpark\Webpack\Loader;
// Give the main directory where the asset is located as parameter.
$loader = new Loader(__DIR__);

// getBundle (extension, entry)
// example.com/assets/bundles/main.[hash].js
$jsBundlde = $loader->getBundle('js', 'main');
$cssBundle = $loader->getBundle('css', 'main');

$loader->setPublicPath("http://192.168.1.99/assets/bundles/");