Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Scripts: Enable React Fast Refresh for block development (#28273)
* Scripts: Enable React Fast Refresh for block development * Externalize React Refresh to make it work without Dev Tools
- Loading branch information
Showing
with
1,571 additions
and 416 deletions.
- +2 −19 lib/client-assets.php
- +1,468 −376 package-lock.json
- +1 −0 package.json
- +8 −0 packages/dependency-extraction-webpack-plugin/lib/util.js
- +6 −0 packages/scripts/CHANGELOG.md
- +3 −0 packages/scripts/README.md
- +27 −17 packages/scripts/config/webpack.config.js
- +4 −2 packages/scripts/package.json
- +1 −1 packages/scripts/scripts/start.js
- +49 −0 tools/webpack/development.js
- +2 −1 webpack.config.js
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -208,7 +208,8 @@ function gutenberg_register_vendor_scripts( $scripts ) { | ||
$scripts, | ||
'react', | ||
'https://unpkg.com/[email protected]/umd/react' . $react_suffix . '.js', | ||
// See https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/docs/TROUBLESHOOTING.md#externalising-react. | ||
SCRIPT_DEBUG ? array( 'wp-react-refresh-entry', 'wp-polyfill' ) : array( 'wp-polyfill' ) | ||
); | ||
gutenberg_register_vendor_script( | ||
$scripts, | ||
@@ -484,24 +485,6 @@ function gutenberg_register_packages_styles( $styles ) { | ||
} | ||
add_action( 'wp_default_styles', 'gutenberg_register_packages_styles' ); | ||
|
||
/** | ||
* Retrieves a unique and reasonably short and human-friendly filename for a | ||
* vendor script based on a URL and the script handle. | ||
Oops, something went wrong.