const path = require('path')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')

const merge = require('webpack-merge')
const common = require('./webpack.config.common.js')

const output = path.resolve('./public')

module.exports = merge(common, {
  mode: 'production',
  output: {
    path: output,
    filename: '[name].[chunkhash].js',
    chunkFilename: 'chunk.[chunkhash].js'
  },
  optimization: {
    splitChunks: {
      chunks: 'all'
    }
  },
  plugins: [
    new UglifyJSPlugin({
      uglifyOptions: {
        ecma: 5
      },
      cache: true,
      parallel: false
    }),
    new OptimizeCssAssetsPlugin()
  ]
})

@@ -466,16 +466,18 @@
 %0A  %7D,%0A  
+//
 optimiza
@@ -488,16 +488,18 @@
 : %7B%0A    
+//
 splitChu
@@ -507,24 +507,26 @@
 ks: %7B%0A      
+//
 chunks: 'all
@@ -535,12 +535,16 @@
     
+//
 %7D%0A  
+//
 %7D,%0A 

Disable splitting all chunks