var webpack = require('webpack'),

    path = require('path'),
    baseDir = path.resolve(__dirname, '..'),

    HtmlWebpackPlugin = require('html-webpack-plugin'),
    CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin'),

    node_modules = path.resolve(baseDir, 'node_modules'),

    pathToMain = path.resolve(baseDir, 'app/main.jsx'),

    jade = require('jade'),
    indexHtml = jade.compileFile(path.resolve(baseDir, 'app/index.jade')),

    deps = [
      'react/dist/react.min.js'
    ];

module.exports = function(options) {
  var entry = options.devServer
    ? ['webpack/hot/dev-server', pathToMain]
    : pathToMain;

  var babel = 'babel?optional=es7.objectRestSpread&optional=runtime';
  var jsLoader = options.flowcheck
    ? ['babel?whitelist[]=flow', 'flowcheck', babel + '&blacklist[]=flow'] // hack from flowcheck/issues#18
    : [babel];
  if (options.hot) { jsLoader.unshift('react-hot'); }

  var config = {
    entry: {
      app: entry,
      vendor: ['react']
    },
    resolve: {
      alias: {}
    },
    devtool: options.devtool,
    debug: options.debug,
    output: {
      path: path.resolve(baseDir, options.outputDir),
      filename: 'bundle.js'
    },
    plugins: [
      new HtmlWebpackPlugin({
        title: 'CircuitSim',
        templateContent: function(templateParams) {
          var files = templateParams.htmlWebpackPlugin.files; // js, css, chunks
          return indexHtml(files);
        }
      }),
      new CommonsChunkPlugin('vendor', 'common.js')
    ],
    module: {
      loaders: [
        {
          test: /\.css$/,
          loaders: ['style', 'css']
        },
        {
          test: /\.scss$/,
          loaders: ['style', 'css', 'sass?includePaths[]=' + require('node-bourbon').includePaths]
        },
        {
          test: /\.(js|jsx)$/,
          exclude: [node_modules],
          loaders: jsLoader
        },
        { // will be run before loaders above
          test: /\.(js|jsx)$/,
          exclude: [node_modules],
          loader: 'eslint-loader'
        },
        {
          // Expose React - react-router requires this
          test: require.resolve('react'),
          loader: 'expose?React'
        },
        {
          test: /\.(png|jpg)$/,
          loader: 'url?limit=25000'
        },
        {
          test: /\.woff$/, // should maybe be .svg instead?
          loader: 'url?limit=100000'
        }
      ],
      noParse: [],
      eslint: {
        'emitWarning': !options.quiet,
        'emitError': !options.quiet,
        'quiet': options.quiet
      }
    }
  };

  if (options.noParseDeps) {
    deps.forEach(function (dep) {
      var depPath = path.resolve(node_modules, dep);
      config.resolve.alias[dep.split(path.sep)[0]] = depPath;
      config.module.noParse.push(depPath);
    });
    config.resolve.alias['react/lib'] = path.resolve(node_modules, 'react/lib');
  }

  if (options.minify) {
    config.plugins.push(new webpack.optimize.UglifyJsPlugin({
        compress: {
            warnings: false
        }
    }));
  }

  return config;
};

@@ -23,25 +23,24 @@
 'webpack'),%0A
-%0A
     path = r
@@ -59,54 +59,8 @@
 '),%0A
-    baseDir = path.resolve(__dirname, '..'),%0A%0A
     
@@ -184,24 +184,97 @@
 nkPlugin'),%0A
+    jade = require('jade');%0A%0Avar baseDir = path.resolve(__dirname, '..'),
 %0A    node_mo
@@ -270,24 +270,26 @@
     node
-_m
+M
 odules
+Dir
  = path.
@@ -318,25 +318,24 @@
 _modules'),%0A
-%0A
     pathToMa
@@ -383,36 +383,8 @@
 ),%0A%0A
-    jade = require('jade'),%0A
     
@@ -1843,32 +1843,34 @@
 clude: %5Bnode
-_m
+M
 odules
+Dir
 %5D,%0A         
@@ -2000,24 +2000,26 @@
 e: %5Bnode
-_m
+M
 odules
+Dir
 %5D,%0A     
@@ -2686,24 +2686,26 @@
 lve(node
-_m
+M
 odules
+Dir
 , dep);%0A
@@ -2874,24 +2874,26 @@
 lve(node
-_m
+M
 odules
+Dir
 , 'react

Remove lint errors from webpack config