Skip to content

Commit

Permalink
Revert "React: Restore umd builds (#63602)"
Browse files Browse the repository at this point in the history
This reverts commit 7351780.
  • Loading branch information
tyxla committed Dec 6, 2024
1 parent bac284b commit f2b3683
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
15 changes: 1 addition & 14 deletions tools/webpack/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,6 @@ const exportDefaultPackages = [
'warning',
];

const copiedVendors = {
'react.js': 'react/umd/react.development.js',
'react.min.js': 'react/umd/react.production.min.js',
'react-dom.js': 'react-dom/umd/react-dom.development.js',
'react-dom.min.js': 'react-dom/umd/react-dom.production.min.js',
};

module.exports = {
...baseConfig,
name: 'packages',
Expand Down Expand Up @@ -185,13 +178,7 @@ module.exports = {
transform: stylesTransform,
noErrorOnMissing: true,
} ) )
.concat( bundledPackagesPhpConfig )
.concat(
Object.entries( copiedVendors ).map( ( [ to, from ] ) => ( {
from: `node_modules/${ from }`,
to: `build/vendors/${ to }`,
} ) )
),
.concat( bundledPackagesPhpConfig ),
} ),
new MomentTimezoneDataPlugin( {
startYear: 2000,
Expand Down
11 changes: 8 additions & 3 deletions tools/webpack/vendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
const { join } = require( 'path' );

const importedVendors = {
react: { import: 'react', global: 'React' },
'react-dom': { import: 'react-dom', global: 'ReactDOM' },
'react-jsx-runtime': {
import: 'react/jsx-runtime',
global: 'ReactJSXRuntime',
Expand Down Expand Up @@ -33,9 +35,12 @@ module.exports = [
},
},

externals: {
react: 'React',
},
externals:
name === 'react'
? {}
: {
react: 'React',
},
};
} );
} ),
Expand Down

0 comments on commit f2b3683

Please sign in to comment.