7

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"
})
Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Mohit Prakash
  • 492
  • 2
  • 7
  • 15

1 Answers1

8

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

Luciano Semerini
  • 656
  • 5
  • 10