Skip to content

Commit beff93c

Browse files
committed
Scripts: Fix misplaced ReactRefreshWebpackPlugin (#57777)
Restore ReactRefreshWebpackPlugin to @wordpress/scripts webpack config. #57461 accidentally moved the plugin to the modules config. It should have remained in the scripts webpack config and not been included in the modules config.
1 parent 60adb37 commit beff93c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/scripts/config/webpack.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ const scriptConfig = {
380380
process.env.WP_BUNDLE_ANALYZER && new BundleAnalyzerPlugin(),
381381
// MiniCSSExtractPlugin to extract the CSS thats gets imported into JavaScript.
382382
new MiniCSSExtractPlugin( { filename: '[name].css' } ),
383+
// React Fast Refresh.
384+
hasReactFastRefresh && new ReactRefreshWebpackPlugin(),
383385
// WP_NO_EXTERNALS global variable controls whether scripts' assets get
384386
// generated, and the default externals set.
385387
! process.env.WP_NO_EXTERNALS &&
@@ -423,8 +425,6 @@ if ( hasExperimentalModulesFlag ) {
423425
process.env.WP_BUNDLE_ANALYZER && new BundleAnalyzerPlugin(),
424426
// MiniCSSExtractPlugin to extract the CSS thats gets imported into JavaScript.
425427
new MiniCSSExtractPlugin( { filename: '[name].css' } ),
426-
// React Fast Refresh.
427-
hasReactFastRefresh && new ReactRefreshWebpackPlugin(),
428428
// WP_NO_EXTERNALS global variable controls whether scripts' assets get
429429
// generated, and the default externals set.
430430
! process.env.WP_NO_EXTERNALS &&

0 commit comments

Comments
 (0)