1. Go to this page and download the library: Download pieceofcake2/webpack-encore 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/ */
pieceofcake2 / webpack-encore example snippets
// app/Controller/AppController.php
App::uses('Controller', 'Controller');
class AppController extends Controller {
public $helpers = ['Html', 'WebpackEncore.Encore'];
}
// app/Config/bootstrap.php
// Full filesystem path to entrypoints.json
Configure::write('WebpackEncore.entrypointsPath', WWW_ROOT . 'build/entrypoints.json');
// Full filesystem path to manifest.json
Configure::write('WebpackEncore.manifestPath', WWW_ROOT . 'build/manifest.json');