Automattic\WooCommerce\Blocks
AssetsController::register_script_modules
Register script modules.
Method of the class: AssetsController{}
No Hooks.
Returns
null
. Nothing (null).
Usage
$AssetsController = new AssetsController(); $AssetsController->register_script_modules();
AssetsController::register_script_modules() AssetsController::register script modules code WC 9.9.4
public function register_script_modules() { // Right now we only have one script modules build for supported interactivity API powered block front-ends. // We generate a combined asset file for that via DependencyExtractionWebpackPlugin to make registration more // efficient. $asset_data = $this->api->get_asset_data( $this->api->get_block_asset_build_path( 'interactivity-blocks-frontend-assets', 'php' ) ); foreach ( $asset_data as $handle => $data ) { $handle_without_js = str_replace( '.js', '', $handle ); wp_register_script_module( $handle_without_js, plugins_url( $this->api->get_block_asset_build_path( $handle_without_js ), dirname( __DIR__ ) ), $data['dependencies'], $data['version'] ); } }