Download the PHP package humanmade/asset-loader without Composer
On this page you can find all versions of the php package humanmade/asset-loader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download humanmade/asset-loader
More information about humanmade/asset-loader
Files in humanmade/asset-loader
Package asset-loader
Short Description Utilities to seamlessly consume Webpack-bundled assets in WordPress themes & plugins.
License GPL-2.0-or-later
Informations about the package asset-loader
Asset Loader
This plugin exposes functions which may be used within other WordPress themes or plugins to aid in detecting and loading assets generated by Webpack, including those served from local webpack-dev-server
instances.
Usage
This library is designed to work in conjunction with a Webpack configuration (such as those created with the presets in @humanmade/webpack-helpers) which generate an asset manifest file. This manifest associates asset bundle names with either URIs pointing to asset bundles on a running DevServer instance, or else local file paths on disk.
Asset_Loader
provides a set of methods for reading in this manifest file and registering a specific resource within it to load within your WordPress website. The primary public interface provided by this plugin is a pair of methods, Asset_Loader\register_asset()
and Asset_Loader\enqueue_asset()
. To register a manifest asset call one of these methods inside actions like wp_enqueue_scripts
or enqueue_block_editor_assets
, in the same manner you would have called the standard WordPress wp_register_script
or wp_enqueue_style
functions.
Documentation
For complete documentation, including contributing process, visit the docs site.
License
This plugin is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.