From fa7dc515e3364b6492f9b5782f2e794b81cc42c9 Mon Sep 17 00:00:00 2001 From: Ryan Shaw Date: Fri, 14 Oct 2016 13:29:48 -0600 Subject: [PATCH] require 'react-dom' when using 'require' and use window.ReactDOM with globals --- webpack.build.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/webpack.build.js b/webpack.build.js index cbd148c..fd92d9a 100644 --- a/webpack.build.js +++ b/webpack.build.js @@ -24,9 +24,24 @@ module.exports = { libraryTarget: 'umd' }, externals: { - 'react': 'React', - 'react/addons': 'React', - 'react-dom': 'ReactDOM' + 'react': { + root: 'React', + commonjs2: 'react', + commonjs: 'react', + amd: 'react' + }, + 'react-dom': { + root: 'ReactDOM', + commonjs2: 'react-dom', + commonjs: 'react-dom', + amd: 'react-dom' + }, + 'react/addons': { + root: 'React', + commonjs2: 'react', + commonjs: 'react', + amd: 'react' + } }, module: { loaders: [