Skip to content

Commit

Permalink
adjust polyfill path and remove from normal webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Jan 17, 2025
1 parent f2fb3d9 commit 44eecbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
2 changes: 1 addition & 1 deletion inc/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public static function assets( $hook ) {
if ( version_compare( $wp_version, '6.6', '>' ) ) {
\wp_register_script(
'react-jsx-runtime',
'@react/jsx-runtime.js',
BLUEHOST_PLUGIN_DIR . '/assets/js/react-jsx-runtime.js',
array( 'react' ),
'18.3.0',
true
Expand Down
23 changes: 1 addition & 22 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,4 @@ const webConfig = {
plugins: [ new ProvidePlugin( mostCommonImports ) ],
};

// jsx polyfill - https://github.com/WordPress/gutenberg/issues/62202#issuecomment-2156796649
// Also see includes/Admin.php:218-227
const reactJSXRuntimePolyfill = {
entry: {
'react-jsx-runtime': {
import: 'react/jsx-runtime',
},
},
output: {
path: path.resolve(__dirname, 'assets/js'),
filename: 'react-jsx-runtime.js',
library: {
name: 'ReactJSXRuntime',
type: 'window',
},
},
externals: {
react: 'React',
},
};

module.exports = merge( wpScriptsConfig, webConfig, reactJSXRuntimePolyfill );
module.exports = merge( wpScriptsConfig, webConfig );

0 comments on commit 44eecbf

Please sign in to comment.