Changeset 53140
- Timestamp:
- 04/11/2022 04:08:12 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Gruntfile.js
r52657 r53140 125 125 WORKING_DIR + 'wp-includes/assets/*', 126 126 WORKING_DIR + 'wp-includes/css/dist/', 127 '!' + WORKING_DIR + 'wp-includes/assets/script-loader- packages.php'127 '!' + WORKING_DIR + 'wp-includes/assets/script-loader-*.php' 128 128 ], 129 129 dynamic: { -
trunk/package.json
r53135 r53140 25 25 ], 26 26 "devDependencies": { 27 "@pmmmwh/react-refresh-webpack-plugin": "0.5.5", 27 28 "@wordpress/babel-preset-default": "6.8.0", 28 29 "@wordpress/dependency-extraction-webpack-plugin": "3.4.1", … … 63 64 "prettier": "npm:wp-prettier@2.0.5", 64 65 "qunit": "~2.18.1", 66 "react-refresh": "0.10.0", 65 67 "sass": "^1.50.0", 66 68 "sinon": "~13.0.1", -
trunk/src/wp-includes/script-loader.php
r53124 r53140 213 213 214 214 return $polyfill; 215 } 216 217 /** 218 * Registers development scripts that integrate with `@wordpress/scripts`. 219 * 220 * @see https://github.com/WordPress/gutenberg/tree/trunk/packages/scripts#start 221 * 222 * @since 6.0.0 223 * 224 * @param WP_Scripts $scripts WP_Scripts object. 225 */ 226 function wp_register_development_scripts( $scripts ) { 227 if ( 228 ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG 229 || empty( $scripts->registered['react'] ) 230 ) { 231 return; 232 } 233 234 $development_scripts = array( 235 'react-refresh-entry', 236 'react-refresh-runtime', 237 ); 238 239 foreach ( $development_scripts as $script_name ) { 240 $assets = include ABSPATH . WPINC . '/assets/script-loader-' . $script_name . '.php'; 241 if ( ! is_array( $assets ) ) { 242 return; 243 } 244 $scripts->add( 245 'wp-' . $script_name, 246 '/wp-includes/js/dist/development/' . $script_name . '.js', 247 $assets['dependencies'], 248 $assets['version'] 249 ); 250 } 251 252 // See https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/docs/TROUBLESHOOTING.md#externalising-react. 253 $scripts->registered['react']->deps[] = 'wp-react-refresh-entry'; 215 254 } 216 255 … … 561 600 function wp_default_packages( $scripts ) { 562 601 wp_default_packages_vendor( $scripts ); 602 wp_register_development_scripts( $scripts ); 563 603 wp_register_tinymce_scripts( $scripts ); 564 604 wp_default_packages_scripts( $scripts ); -
trunk/webpack.config.js
r51501 r53140 1 1 const blocksConfig = require( './tools/webpack/blocks' ); 2 const developmentConfig = require( './tools/webpack/development' ); 2 3 const mediaConfig = require( './tools/webpack/media' ); 3 4 const packagesConfig = require( './tools/webpack/packages' ); … … 14 15 const config = [ 15 16 blocksConfig( env ), 17 ...developmentConfig( env ), 16 18 mediaConfig( env ), 17 19 packagesConfig( env ),
Note: See TracChangeset
for help on using the changeset viewer.