import webpack from 'webpack';
import yargs from 'yargs';

const { optimizeMinimize } = yargs.alias('p', 'optimize-minimize').argv;
const nodeEnv = optimizeMinimize ? 'production' : 'development';

export default {
  entry: {
    ReactRouterBootstrap: './src/index.js',
  },

  output: {
    path: './lib',
    filename: optimizeMinimize ? '[name].min.js' : '[name].js',
    library: 'ReactRouterBootstrap',
    libraryTarget: 'umd',
  },

  module: {
    loaders: [
      { test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
    ],
  },

  externals: [
    {
      react: {
        root: 'React',
        commonjs2: 'react',
        commonjs: 'react',
        amd: 'react',
      },
    },
    {
      'react-router': {
        root: 'ReactRouter',
        commonjs2: 'react-router',
        commonjs: 'react-router',
        amd: 'react-router',
      },
    },
  ],

  plugins: [
    new webpack.DefinePlugin({
      'process.env': { NODE_ENV: JSON.stringify(nodeEnv) },
    }),
  ],

  devtool: optimizeMinimize ? 'source-map' : null,
};

@@ -717,16 +717,20 @@
 t-router
+-dom
 ': %7B%0A   
@@ -748,24 +748,27 @@
 'ReactRouter
+DOM
 ',%0A        c
@@ -782,32 +782,36 @@
 2: 'react-router
+-dom
 ',%0A        commo
@@ -820,32 +820,36 @@
 s: 'react-router
+-dom
 ',%0A        amd: 
@@ -861,16 +861,20 @@
 t-router
+-dom
 ',%0A     

Fix webpack config