/*eslint-disable*/

var resolveHere = require('path').resolve.bind(null, __dirname);
var assignDeep = require('assign-deep');
var webpack = require('webpack');
var version = require('./package.json').version;

var env = process.env.NODE_ENV || 'development';

var bannerPlugin = new webpack.BannerPlugin('Catalog ' + version + ' http://interactivethings.github.io/catalog/');

var baseConfig = {
  entry: resolveHere('src/index-standalone'),
  output: {
    library: 'Catalog',
    libraryTarget: 'umd'
  },
  module: {
    loaders: [{test: /\.js$/, include: [resolveHere('src')], loader: 'babel'}],
    noParse: /\.min\.js$/
  }
};

var webpackConfig = {
  // Used for the local development server
  hot: {
    entry: [
      'webpack-hot-middleware/client?noInfo=true&reload=true',
      resolveHere('src/index-standalone')
    ],
    output: {
      path: resolveHere('.'),
      filename: 'catalog.js',
      pathinfo: true
    },
    externals: {
      'babel-standalone': 'Babel'
    },
    devtool: '#eval-source-map',
    plugins: [
      new webpack.DefinePlugin({
       'process.env.NODE_ENV': JSON.stringify('catalog-hot-development')
      }),
      new webpack.HotModuleReplacementPlugin(),
      new webpack.optimize.OccurenceOrderPlugin()
    ]
  },

  // The standalone builds are now built with Rollup because the resulting files are around 13–21% smaller

  // // Used for unminified development build
  // development: {
  //   plugins: [
  //     new webpack.DefinePlugin({
  //      '__DEV__': JSON.stringify(true),
  //      'process.env.NODE_ENV': JSON.stringify('development')
  //     }),
  //     new webpack.optimize.OccurenceOrderPlugin(),
  //     bannerPlugin
  //   ]
  // },

  // // Minified production build
  // production: {
  //   resolve: {
  //     alias: {
  //       // Shaves off 70 kB from minified build!
  //       'js-yaml': 'js-yaml/dist/js-yaml.min.js'
  //     }
  //   },
  //   plugins: [
  //     new webpack.DefinePlugin({
  //       '__DEV__': JSON.stringify(false),
  //       'process.env.NODE_ENV': JSON.stringify('production')
  //     }),
  //     new webpack.optimize.DedupePlugin(),
  //     new webpack.optimize.OccurenceOrderPlugin(),
  //     new webpack.optimize.UglifyJsPlugin({
  //       compress: {
  //         warnings: false
  //       }
  //     }),
  //     bannerPlugin
  //   ]
  // }
};

module.exports = assignDeep({}, baseConfig, webpackConfig[env]);

@@ -1,27 +1,9 @@
-/*eslint-disable*/%0A%0Avar
+const
  res
@@ -64,633 +64,64 @@
 e);%0A
-var assignDeep = require('assign-deep');%0Avar webpack = require('webpack');%0Avar version = require('./package.json').version;%0A%0Avar env = process.env.NODE_ENV %7C%7C 'development';%0A%0Avar bannerPlugin = new webpack.BannerPlugin('Catalog ' + version + ' http://interactivethings.github.io/catalog/');%0A%0Avar baseConfig = %7B%0A  entry: resolveHere('src/index-standalone'),%0A  output: %7B%0A    library: 'Catalog',%0A    libraryTarget: 'umd'%0A  %7D,%0A  module: %7B%0A    loaders: %5B%7Btest: /%5C.js$/, include: %5BresolveHere('src')%5D, loader: 'babel'%7D%5D,%0A    noParse: /%5C.min%5C.js$/%0A  %7D%0A%7D;%0A%0Avar webpackConfig = %7B%0A  // Used for the local development server%0A  hot: %7B%0A  
+const webpack = require('webpack');%0A%0Amodule.exports = %7B%0A
   en
@@ -123,26 +123,24 @@
 %0A  entry: %5B%0A
-  
     'webpack
@@ -188,18 +188,16 @@
 =true',%0A
-  
     reso
@@ -232,17 +232,13 @@
 e')%0A
-  
   %5D,%0A
-  
   ou
@@ -243,24 +243,72 @@
 output: %7B%0A  
+  library: 'Catalog',%0A    libraryTarget: 'umd',%0A
     path: re
@@ -323,18 +323,16 @@
 e('.'),%0A
-  
     file
@@ -355,18 +355,16 @@
 s',%0A    
-  
 pathinfo
@@ -374,1008 +374,229 @@
 rue%0A
-  
   %7D,%0A  
-  externals: %7B%0A      'babel-standalone': 'Babel'%0A    %7D,%0A    devtool: '#eval-source-map',%0A    plugins: %5B%0A      new webpack.DefinePlugin(%7B%0A       'process.env.NODE_ENV': JSON.stringify('catalog-hot-development')%0A      %7D),%0A      new webpack.HotModuleReplacementPlugin(),%0A      new webpack.optimize.OccurenceOrderPlugin()
+module: %7B%0A    loaders: %5B%0A      %7Btest: /%5C.js$/, include: resolveHere('src'), loader: 'babel'%7D
 %0A    %5D
-%0A  %7D
 ,%0A
-%0A
   
-// The standalone builds are now built with Rollup because the resulting files are around 13%E2%80%9321%25 smaller%0A%0A  // // Used for unminified development build%0A  // development: %7B%0A  //   plugins: %5B%0A  //     new webpack.DefinePlugin(%7B%0A  //      '__DEV__': JSON.stringify(true),%0A  //      'process.env.NODE_ENV': JSON.stringify('development')%0A  //     %7D),%0A  //     new webpack.optimize.OccurenceOrderPlugin(),%0A  //     bannerPlugin%0A  //   %5D%0A  // %7D,%0A%0A  // // Minified production build%0A  // production: %7B%0A  //   resolve: %7B%0A  //     alias: %7B%0A  //       // Shaves off 70 kB from minified build!%0A  //       'js-yaml': 'js-yaml/dist/js-yaml.min.js'%0A  //     %7D%0A  //   %7D,%0A  // 
+  noParse: /%5C.min%5C.js$/%0A  %7D,%0A  externals: %7B%0A    'babel-standalone': 'Babel'%0A  %7D,%0A  devtool: '#eval-source-map',%0A
   pl
@@ -604,25 +604,20 @@
 gins: %5B%0A
-  //
     
- 
 new webp
@@ -624,473 +624,40 @@
 ack.
-DefinePlugin(%7B%0A  //       '__DEV__': JSON.stringify(false),%0A  //       'process.env.NODE_ENV': JSON.stringify('production')%0A  //     %7D),%0A  //     new webpack.optimize.DedupePlugin(),%0A  //     new webpack.optimize.OccurenceOrderPlugin(),%0A  //     new webpack.optimize.UglifyJsPlugin(%7B%0A  //       compress: %7B%0A  //         warnings: false%0A  //       %7D%0A  //     %7D),%0A  //     bannerPlugin%0A  //   %5D%0A  // %7D%0A%7D;%0A%0Amodule.exports = assignDeep(%7B%7D, baseConfig, webpackConfig%5Benv%5D)
+HotModuleReplacementPlugin()%0A  %5D%0A%7D
 ;%0A

Clean up webpack config