PHP code example of rodrigoq / simple-webpack-encore-bundle

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

    

rodrigoq / simple-webpack-encore-bundle example snippets


    use Simple\WebpackEncoreBundle\Twig\EntryFilesTwigExtension;
    ...
    $entrypointJsonFile = "path/to/entrypoints.json";
    $twigEnvironment->addExtension(new EntryFilesTwigExtension($entrypointJsonFile));

    use Simple\WebpackEncoreBundle\Twig\EntryFilesTwigExtension;
    ...
    $builds = [
        'firstConfig' => "path/to/firstConfig/entrypoints.json",
        'secondConfig' => "path/to/secondConfig/entrypoints.json",
    ];
    $twigEnvironment->addExtension(new EntryFilesTwigExtension($builds));