Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead

I am getting this error

Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead.

new webpack.optimize.CommonsChunkPlugin({
  filename: DEBUG ? 'bundle.js' : 'bundle.min.js',
  name: "vendor"
})
like image 485
Mohit Prakash Avatar asked Apr 04 '19 06:04

Mohit Prakash


1 Answers

As the error states, the plugin is deprecated since webpack 4

You should remove it and use a different plugin.

There are plenty of posts where you can find how to do this but here is an example: Webpack 4 migration CommonsChunkPlugin

like image 161
Luciano Semerini Avatar answered Sep 20 '22 18:09

Luciano Semerini