From de5b2bf3c8c55e9a29244da1f6a6ebf3875842c1 Mon Sep 17 00:00:00 2001 From: Vandish Gandhi Date: Fri, 14 Jun 2019 14:36:19 +1000 Subject: [PATCH] fix: add external to dev build --- config/webpack.config.dev.build.js | 40 +++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/config/webpack.config.dev.build.js b/config/webpack.config.dev.build.js index 54f312af1..520e54559 100644 --- a/config/webpack.config.dev.build.js +++ b/config/webpack.config.dev.build.js @@ -12,7 +12,7 @@ module.exports = webpackMerge(commonConfig, { mode: 'development', // You may want 'eval' instead if you prefer to see the compiled output in DevTools. // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343. - devtool: 'source-map', + devtool: 'cheap-eval-source-map', entry: paths.appSrc, output: { path: paths.appBuild, @@ -20,6 +20,44 @@ module.exports = webpackMerge(commonConfig, { libraryTarget: 'umd', library: 'AdslotUI', }, + externals: { + lodash: { + root: '_', + commonjs2: 'lodash', + commonjs: 'lodash', + amd: 'lodash', + }, + react: { + root: 'React', + commonjs2: 'react', + commonjs: 'react', + amd: 'react', + }, + 'react-dom': { + root: 'ReactDOM', + commonjs2: 'react-dom', + commonjs: 'react-dom', + amd: 'react-dom', + }, + 'react-redux': { + root: 'reactRedux', + commonjs2: 'react-redux', + commonjs: 'react-redux', + amd: 'react-redux', + }, + redux: { + root: 'Redux', + commonjs2: 'redux', + commonjs: 'redux', + amd: 'redux', + }, + moment: { + root: 'moment', + commonjs2: 'moment', + commonjs: 'moment', + amd: 'moment', + }, + }, module: { strictExportPresence: true, rules: [