From cf97a83c58a15c8e381fa7a8175105b6142aa078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Tue, 3 Dec 2024 04:26:57 +0100 Subject: [PATCH] Apply suggestions from code review --- packages/dependency-extraction-webpack-plugin/lib/index.js | 1 + packages/scripts/config/webpack.config.js | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/dependency-extraction-webpack-plugin/lib/index.js b/packages/dependency-extraction-webpack-plugin/lib/index.js index 15307716ce44c9..8bc7cb29312161 100644 --- a/packages/dependency-extraction-webpack-plugin/lib/index.js +++ b/packages/dependency-extraction-webpack-plugin/lib/index.js @@ -388,6 +388,7 @@ class DependencyExtractionWebpackPlugin { } if ( compilation.options?.optimization?.runtimeChunk !== false ) { + // Sets the script handle for the shared runtime file so WordPress registers it only once when using the asset file. assetData.handle = compilation.name + '-' + diff --git a/packages/scripts/config/webpack.config.js b/packages/scripts/config/webpack.config.js index 9dfb64e9245fba..2c3d423fcbd1e8 100644 --- a/packages/scripts/config/webpack.config.js +++ b/packages/scripts/config/webpack.config.js @@ -342,6 +342,7 @@ const scriptConfig = { } ); if ( hasReactFastRefresh ) { + // Prepends the file reference to the shared runtime chunk to every script type defined for the block. const runtimePath = relative( dirname( absoluteFrom ), fromProjectRoot(