Skip to content

Commit

Permalink
Promote require rather than include for the asset file
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Sep 16, 2019
1 parent bd0a56c commit a0dd11b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/dependency-extraction-webpack-plugin/README.md
Expand Up @@ -217,7 +217,7 @@ Enqueue your script as usual and read the script dependencies dynamically:
$script_path = 'path/to/script.js';
$script_asset_path = 'path/to/script.asset.php';
$script_asset = file_exists( $script_asset_path )
? include( $script_asset_path ) )
? require( $script_asset_path ) )
: array( 'dependencies' => array(), 'version' => filemtime( $script_path ) );
$script_url = plugins_url( $script_path, __FILE__ );
wp_enqueue_script( 'script', $script_url, $script_asset['dependencies'], $script_asset['version'] );
Expand Down

0 comments on commit a0dd11b

Please sign in to comment.