tilpark/webpack-loader

Php core webpack loader

v1.2.1 2021-01-11 17:52 UTC

This package is not auto-updated.

Last update: 2024-11-13 10:35:49 UTC


README

webpack loader consumes the output generated by webpack-bundle-tracker and lets you use the generated bundles in php.

Install

composer require tilpark/webpack-loader

Usage

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');

Options

Set PublicPath Manually

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