wp_register_development_scripts
函数
      wp_register_development_scripts ( $scripts )    
  - 参数
 - 
- 
                (WP_Scripts)
$scripts
WP_Scripts object.- Required: 是
 
 
 - 
                (WP_Scripts)
 
- 相关
 - 
- https://github.com/WordPress/gutenberg/tree/trunk/packages/scripts#start
 
 
- 定义位置
 - 
- 
                                  wp-includes/script-loader.php
, line 226 
 - 
                                  wp-includes/script-loader.php
 
- 引入
 - 6.0.0
 
- 弃用
 - –
 
Registers development scripts that integrate with `@wordpress/scripts`.
function wp_register_development_scripts( $scripts ) {
	if (
		! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG
		|| empty( $scripts->registered['react'] )
		|| defined( 'WP_RUN_CORE_TESTS' )
	) {
		return;
	}
	$development_scripts = array(
		'react-refresh-entry',
		'react-refresh-runtime',
	);
	foreach ( $development_scripts as $script_name ) {
		$assets = include ABSPATH . WPINC . '/assets/script-loader-' . $script_name . '.php';
		if ( ! is_array( $assets ) ) {
			return;
		}
		$scripts->add(
			'wp-' . $script_name,
			'/wp-includes/js/dist/development/' . $script_name . '.js',
			$assets['dependencies'],
			$assets['version']
		);
	}
	// See https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/docs/TROUBLESHOOTING.md#externalising-react.
	$scripts->registered['react']->deps[] = 'wp-react-refresh-entry';
}
	声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
		

