Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo authored Dec 3, 2024
1 parent dad5d04 commit b024d2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/dependency-extraction-webpack-plugin/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ 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 +
'-' +
Expand Down
2 changes: 2 additions & 0 deletions packages/scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ 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(
Expand Down

0 comments on commit b024d2d

Please sign in to comment.