From 659bed461b47c7e508f91cb2879a0e00026b74f1 Mon Sep 17 00:00:00 2001 From: Eimi Okuno Date: Wed, 8 Apr 2020 20:51:57 +0900 Subject: [PATCH] Adding array, simplifying the alias --- webpack.config.js | 40 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 9bfada8..2a2ec45 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -64,12 +64,14 @@ module.exports = { include: path.resolve(__dirname, 'src'), // TODO: because it uses entry point to determine graph of dependencies, might not be needed to exclude test ans sample files? exclude: /(node_modules|bower_components|build|dist|demo|.storybook|storybook-static)/, - use: { - loader: 'babel-loader', - options: { - presets: [ '@babel/preset-env', '@babel/preset-react' ] + use: [ + { + loader: 'babel-loader', + options: { + presets: [ '@babel/preset-env', '@babel/preset-react' ] + } } - } + ] } ] }, @@ -86,29 +88,9 @@ module.exports = { }, externals: { // Don't bundle react or react-dom or react-router - react: { - commonjs: 'react', - commonjs2: 'react', - amd: 'React', - root: 'React' - }, - 'react-dom': { - commonjs: 'react-dom', - commonjs2: 'react-dom', - amd: 'ReactDOM', - root: 'ReactDOM' - }, - 'react-router': { - commonjs: 'react-router', - commonjs2: 'react-router', - amd: 'ReactRouter', - root: 'ReactRouter' - }, - 'react-router-dom': { - commonjs: 'react-router-dom', - commonjs2: 'react-router-dom', - amd: 'ReactRouterDOM', - root: 'ReactRouterDOM' - } + react: 'react', + 'react-dom': 'react-dom', + 'react-router': 'react-router', + 'react-router-dom': 'react-router-dom' } };