PHP code example of antiseptikk / wordpress-encore

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

    

antiseptikk / wordpress-encore example snippets




re = new \Antiseptikk\Encore('build', '1.0.0', 'my-website.com');



$encore = new \Antiseptikk\Encore('build', '1.0.0', WP_HOME);



use Antiseptikk\Encore;

class Bootstrap
{
    private $encore;   

    public function __constuct()
    {
        $this->encore = new Encore('build', '1.0.0', WP_HOME);
        add_action('wp_enqueue_scripts', [$this, 'enqueue_assets']);
    }

    public function enqueue_assets()
    {
        $this->encore->enqueue('app', 'main', []);
    }
}