Skip to content

Commit

Permalink
Update the script registration of the react scripts with a cache vers…
Browse files Browse the repository at this point in the history
…ion (#46768)
  • Loading branch information
youknowriad committed Dec 23, 2022
1 parent 017b7f6 commit 2128c28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,13 +558,15 @@ function gutenberg_register_vendor_scripts( $scripts ) {
'react',
gutenberg_url( 'build/vendors/react' . $extension ),
// 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' )
SCRIPT_DEBUG ? array( 'wp-react-refresh-entry', 'wp-polyfill' ) : array( 'wp-polyfill' ),
'18'
);
gutenberg_override_script(
$scripts,
'react-dom',
gutenberg_url( 'build/vendors/react-dom' . $extension ),
array( 'react' )
array( 'react' ),
'18'
);
}
add_action( 'wp_default_scripts', 'gutenberg_register_vendor_scripts' );
Expand Down

0 comments on commit 2128c28

Please sign in to comment.