text: const path = require('path');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const WebpackMd5Hash = require('webpack-md5-hash');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin')
  
  const extractCSS = new MiniCssExtractPlugin({
    filename: '[name].[hash].css',
    chunkFilename: '[id].[hash].css'
    });
  
  module.exports = {
    mode: "production",
    devtool: 'source-map',
    devServer: {
      noInfo: true,
      open: true
    },
    optimization: {
      minimize: true,
      removeEmptyChunks: true,
      mergeDuplicateChunks: true,
      splitChunks: {
        chunks: "all"
      }
    },
    entry: {
      main: path.resolve(__dirname, 'src/index')    
  },
    target: 'web',
    output: {
      path: path.resolve(__dirname, 'dist'),
      publicPath: '/',
      filename: '[name].[chunkhash].js'    
    },
    plugins: [      
      extractCSS,
      new WebpackMd5Hash(),
  
      // Create HTML file that includes reference to bundled JS.
      new HtmlWebpackPlugin({
        template: 'src/index.html',
        minify: {
          removeComments: true,
          collapseWhitespace: true,
          removeRedundantAttributes: true,
          useShortDoctype: true,
          removeEmptyAttributes: true,
          removeStyleLinkTypeAttributes: true,
          keepClosingSlash: true,
          minifyJS: true,
          minifyCSS: true,
          minifyURLs: true
        },
        inject: true,
        tracJKSToken: 'sample-token'
      })
    ],
    module: {
      rules: [
        { test: /\.css$/, use: [ MiniCssExtractPlugin.loader, 'css-loader' ] },
        { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }   
      ]
    },
  }
  