Bundle all kinds of assets and enqueue them at once

dev-master 2018-01-31 15:46 UTC

This package is auto-updated.

Last update: 2024-05-29 04:27:51 UTC


This is a small library that allows developers to create bundles of various asset types. Scripts, styles and other, custom asset types can be registered as a package. All assets are enqueued together when the AssetBundle is enqueued.


Fetch this package via composer: composer require biont/wordpress-asset-bundles


$bundle  => new AssetBundle( 'my_bundle', [
    new Script(
    // Script handle
    // Script path
    $asset_dir . 'js/asset.js',
    // Dependencies
    [ 'jquery' ]
	new Style( 'my_asset_css', $asset_dir . 'css/asset.css' ),
] );

// Call $bundle->enqueue() whenever you need your assets