From 56bb6669b8ad57dcf3077622cad6fec17228be44 Mon Sep 17 00:00:00 2001 From: Carlos Filoteo Date: Fri, 15 Jan 2021 12:17:22 -0700 Subject: [PATCH] Fix Webpack externals config to support more than global variable --- scripts/webpack/webpack-resources.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/webpack/webpack-resources.js b/scripts/webpack/webpack-resources.js index 48d62bbb083d6..0f3218fc497f7 100644 --- a/scripts/webpack/webpack-resources.js +++ b/scripts/webpack/webpack-resources.js @@ -205,8 +205,16 @@ module.exports = { : output, externals: { - react: 'React', - 'react-dom': 'ReactDOM', + react: { + commonjs: 'react', + amd: 'react', + root: 'React', + }, + 'react-dom': { + commonjs: 'react-dom', + amd: 'react-dom', + root: 'ReactDOM', + }, }, resolve: {