title: unable to Compress into gzip in webpack
body: <p>I want to compress my react app into gzip,actually it is 2.2 mb so I used <strong><a href="https://github.com/webpack-contrib/compression-webpack-plugin" rel="nofollow noreferrer">compression-webpack-plugin</a></strong> but i'm unable to compress<br>
  my <em><strong>webpack.config.js</strong></em></p>
  <pre><code>const webpack = require('webpack');
  const path = require('path');
  const fs = require(&quot;fs&quot;)
  const ExtractTextPlugin = require('extract-text-webpack-plugin');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
  const CompressionPlugin = require('compression-webpack-plugin');
  
  const VENDOR_LIBS =[
      'antd','axios','moment','rc-time-picker','react',
      'react-dom','react-ga','react-google-maps','react-loadable',
      'react-redux','react-router','react-router-dom','recompose','redux','redux-thunk'
  ]
  module.exports = (env) =&gt; {
      const isProduction = env === 'production';
      const CSSExtract = new ExtractTextPlugin('styles.css');
  
      return {
          node: {
              fs: 'empty',
              child_process: 'empty',
            },
          entry: {
              bundle:'./src/app.js',
              vendor:VENDOR_LIBS
          },
          output: {
              path: path.join(__dirname, 'public'),
              filename: '[name].js'
          },
          module: {
              rules: [{
                  loader: 'babel-loader',
                  test: /\.js$/,
                  exclude: /node_modules/
              }, {
                  test: /\.s?css$/,
                  use: CSSExtract.extract({
                      use: [
                          {
                              loader: 'css-loader',
                              options: {
                                  sourceMap: true
                              }
                          },
                          {
                              loader: 'sass-loader',
                              options: {
                                  sourceMap: true
                              }
                          }
                      ]
                  })
              },{
                  test: /\.(gif|svg|jpg|png|ttf|eot|woff(2)?)(\?[a-z0-9=&amp;.]+)?$/,
                  loader: &quot;file-loader&quot;,
              }],
          },
          
          plugins: [
              CSSExtract,
              new webpack.optimize.CommonsChunkPlugin({
                  name:'vendor'
              }),
              new HtmlWebpackPlugin({
                  template:'src/index.html'
              }),
              new CompressionPlugin(),
              new BundleAnalyzerPlugin()
              
          ],
          devtool: isProduction ? 'source-map' : 'inline-source-map',
          devServer: {
              contentBase: path.join(__dirname, 'public'),
              historyApiFallback: true,
              host:'0.0.0.0',
              disableHostCheck: true,
          }
      };
  };
  </code></pre>
  <p><strong>it showing me error</strong></p>
  <blockquote>
  <p>TypeError: Cannot read property 'emit' of undefined<br>
  at CompressionPlugin.apply (/media/.........<br>
  if i add addition options to the <strong>CompressionPlugin</strong> like</p>
  </blockquote>
  <pre><code>new CompressionPlugin({
    asset: '[path].gz[query]',
    algorithm: 'gzip',
    test: /\.js$|\.css$|\.html$|\.eot?.+$|\.ttf?.+$|\.woff?.+$|\.svg?.+$/,
    threshold: 10240,
    minRatio: 0.8
    })
  </code></pre>
  <p>it showing me error</p>
  <blockquote>
  <p>throw new ValidationError(ajv.errors, name); <br>
  ValidationError: Compression Plugin Invalid Options <br>
  options should NOT have additional properties <br></p>
  </blockquote>
  <p>how can I solve this issue or is there any other way to gzip my app.</p>