According to the guidelines webpack, knocking the demo CommonsChunkPlugin used in this plugin, reported the following error:
Use the guide:
plugins: [ new new HTMLWebpackPlugin ({ title: 'Code Splitting' }), + new new webpack.optimize.CommonsChunkPlugin ({ + name: 'Common' // specified public bundle name. + }) ],
Solution:
plugins: [ new new HTMLWebpackPlugin ({ title: 'Code Splitting' }), - new new webpack.optimize.CommonsChunkPlugin ({ - name: 'Common' // specified public bundle name. - }) ], + Optimization: { + splitChunks : { + cacheGroups: { + commoms: { + name: 'Commons' , + of chunks are: 'Initial' , + minChunks: 2 + } + } + } +}