const HtmlWebpackPlugin = require('html-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const CopyWebpackPlugin = require('copy-webpack-plugin')
const path = require('path')
const webpack = require('webpack')

const DIST_DIR = 'public'
const SRC_DIR = 'src'

module.exports = {
  entry: {
    app: './src/index.js',
  },
  output: {
    publicPath: '/',
    filename: '[name]-[hash].min.js',
    path: path.resolve(__dirname, DIST_DIR),
  },
  plugins: [
    new CleanWebpackPlugin(
      [DIST_DIR],
      {
        exclude: ['vendor'],
      },
    ),
    // new webpack.DllReferencePlugin({
    //   context: '.',
    //   manifest: require('./public/vendor/vendor-manifest.json'),
    // }),
    new HtmlWebpackPlugin({
      template: 'src/_tpl/index.html',
      inject: 'body',
      filename: 'index.html',
    }),
    new BundleAnalyzerPlugin({
      analyzerMode: 'static',
      openAnalyzer: false,
      reportFilename: 'report.html',
    }),
    new CopyWebpackPlugin([
      { from: path.join(SRC_DIR, '/_tpl/favicon.ico'), to: 'favicon.ico' },
      { from: path.join(SRC_DIR, '/_tpl/icon-192x192.png'), to: 'icon-192x192.png' },
      { from: path.join(SRC_DIR, '/_tpl/icon-512x512.png'), to: 'icon-512x512.png' },
      { from: path.join(SRC_DIR, '/_tpl/manifest.json'), to: 'manifest.json' },
    ]),
  ],
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['env'],
          },
        },
      },
    ],
  },
  resolve: {
    extensions: ['.js'],
    modules: [
      './node_modules',
      './src',
    ],
  },
}

@@ -283,43 +283,8 @@
 th')
-%0Aconst webpack = require('webpack')
 %0A%0Aco
@@ -553,23 +553,16 @@
 kPlugin(
-%0A      
 %5BDIST_DI
@@ -567,202 +567,8 @@
 DIR%5D
-,%0A      %7B%0A        exclude: %5B'vendor'%5D,%0A      %7D,%0A    ),%0A    // new webpack.DllReferencePlugin(%7B%0A    //   context: '.',%0A    //   manifest: require('./public/vendor/vendor-manifest.json'),%0A    // %7D
 ),%0A 

Remove webpack DllReferencePlugin from webpack config