title: TypeError: webpack.LoaderOptionsPlugin is not a function
body: <p>This is my webpack config for the production environment.</p>
  
  <pre><code>    var path = require('path');
      var webpack = require('webpack');
      var precss = require('precss');
      var autoprefixer = require('autoprefixer');
      var SaveAssetsJson = require('assets-webpack-plugin');
  
      ...
  
      console.log('Build optimized for production\n');
  
      config.output.filename = '[hash].plan.js';
  
      config.module.loaders.push({
        test: /\.js$/,
        loaders: ['babel'],
        exclude: /node_modules/,
        include: path.join(__dirname, 'app'),
      }); 
  </code></pre>
  
  <p>It is consumed via npm/package.json. In the <code>package.json</code> <code>scripts</code> section, here is the <code>build</code> target:</p>
  
  <pre><code>"build": "NODE_ENV=production webpack -p --config webpack.config.js",
  </code></pre>
  
  <p>Now I want to turn off output script uglification for a certain environment mainly for debug purpose. </p>
  
  <p>Here is my new additional webpack configuration:</p>
  
  <pre><code> switch (process.env.NODE_ENV) {
   case 'staging':
      console.log(`Build optimized for ${process.env.NODE_ENV}\n`);
  
      config.output.filename = '[hash].plan.js';
  
      config.module.loaders.push({
        test: /\.js$/,
        loaders: ['babel'],
        exclude: /node_modules/,
        include: path.join(__dirname, 'app'),
      });
  
      config.plugins = [
        new webpack.LoaderOptionsPlugin({
              minimize: true,
              debug: false
          }),
          new webpack.optimize.UglifyJsPlugin({
              beautify: false,
              comments: false
          })
      ]
      break;
  ...
  </code></pre>
  
  <p>Related dependency inside package.json</p>
  
  <pre><code> assets-webpack-plugin": "3.5.0",
  "webpack": "1.13.3",
  </code></pre>
  
  <p>I copy the plugins config from the webpack documentation here <a href="https://webpack.js.org/guides/production-build/" rel="nofollow noreferrer">https://webpack.js.org/guides/production-build/</a></p>
  
  <p>However, when I run <code>npm run build:staging</code>, I got this error:</p>
  
  <pre><code>&gt; plan@1.0.0 build:staging /Users/antkong/project
  &gt; NODE_ENV=staging webpack --config webpack.config.js
  
  Build optimized for staging
  
  /Users/antkong/project/webpack.config.js:82
        new webpack.LoaderOptionsPlugin({
        ^
  </code></pre>
  
  <p>Corresponding command in package.json:</p>
  
  <pre><code>"build:staging": "NODE_ENV=staging webpack --config webpack.config.js",
  </code></pre>
  
  <p>What did I miss? Is there any dev dependency I should install?</p>