const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');

// const webpack = require('webpack');

const config = {
  entry: {
    app: [path.resolve(process.cwd(), `demo/index.js`)]
  },
  output: {
    path: path.resolve(process.cwd(), `gh-page`),
    filename: `bundle.js`,
    pathinfo: false
  },
  module:{
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: 'babel-loader'
      },
      {
        test: /\.css$/,
        use: ['style-loader', 'css-loader']
      }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      inject: true,
      template: path.resolve(__dirname, 'demo', 'index.html'),
      minify: {
        removeComments: true,
        collapseWhitespace: true,
        removeRedundantAttributes: true,
        useShortDoctype: true,
        removeEmptyAttributes: true,
        removeStyleLinkTypeAttributes: true,
        keepClosingSlash: true,
        minifyJS: true,
        minifyCSS: true,
        minifyURLs: true
      }
    }),
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify('production')
      }
    }),
    new webpack.optimize.UglifyJsPlugin()
  ],
  performance: {
    hints: false
  }
};
module.exports = config;
@@ -562,16 +562,253 @@
 oader'%5D%0A
+      %7D,%0A      %7B%0A        test: /%5C.(jpe?g%7Cpng%7Cgif%7Csvg)$/i,%0A        loaders: %5B%0A          'file-loader?hash=sha512&digest=hex&name=%5Bhash%5D.%5Bext%5D',%0A          'image-webpack-loader?bypassOnDebug&optimizationLevel=7&interlaced=false'%0A        %5D%0A
       %7D%0A

Update webpack production config