/* eslint-disable import/no-commonjs */

const webpack = require('webpack')

const baseConfig = {
  entry: './src/index.js',
  module: {
    rules: [
      {
        test: /\.js$/,
        use: 'babel-loader',
        exclude: /node_modules/,
      },
    ],
  },
  output: {
    library: 'ReduxMost',
    libraryTarget: 'umd',
  },
  externals: {
    most: {
      root: 'most',
      commonjs2: 'most',
      commonjs: 'most',
      amd: 'most',
    },
    redux: {
      root: 'Redux',
      commonjs2: 'redux',
      commonjs: 'redux',
      amd: 'redux',
    },
  },
  resolve: {
    extensions: ['.js'],
    mainFields: ['module', 'main', 'jsnext:main'],
  },
}

const devConfig = {
  ...baseConfig,
  output: {
    ...baseConfig.output,
    filename: './dist/redux-most.js',
  },
  plugins: [
    new webpack.EnvironmentPlugin({
      'NODE_ENV': 'development',
    }),
  ],
}

const prodConfig = {
  ...baseConfig,
  output: {
    ...baseConfig.output,
    filename: './dist/redux-most.min.js',
  },
  plugins: [
    new webpack.EnvironmentPlugin({
      'NODE_ENV': 'production',
    }),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        screw_ie8: true,
        warnings: false,
      },
      comments: false,
    }),
  ],
}

module.exports = [devConfig, prodConfig]

@@ -1248,16 +1248,280 @@
   %5D,%0A%7D%0A%0A
+// This is a not well documented feature of Webpack.%0A// When exporting an array Webpack 2 will run%0A// multiple times... once for each config in the%0A// array (synchronously from first to last). This%0A// is what allows us to use multiple configs in%0A// a single file.%0A
 module.e

Add a comment about Webpack config array exports for clarity