Skip to content

Commit 3a5b61c

Browse files
authored
wpcom-block-editor: bundle the react-jsx-runtime code (#97319)
1 parent c1db52b commit 3a5b61c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apps/wpcom-block-editor/webpack.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ function getWebpackConfig(
7373
if ( request === 'tinymce/tinymce' ) {
7474
return 'tinymce';
7575
}
76+
// Force bundling the React JSX runtime packages so that we don't have a missing `react-jsx-runtime`
77+
// dependency on older WordPress versions that don't ship it yet.
78+
if ( request === 'react/jsx-runtime' || request === 'react/jsx-dev-runtime' ) {
79+
// returning null means don't externalize;
80+
// returning undefined means call the default `requestToExternal`, which _would_ externalize `react-jsx-runtime`.
81+
return null;
82+
}
7683
},
7784
requestToHandle( request ) {
7885
if ( request === 'tinymce/tinymce' ) {

0 commit comments

Comments
 (0)