Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CommonChunkPlugin is not a constructor

Getting this error for some strange reason

TypeError: webpack.CommonsChunkPlugin is not a constructor

Other plugins are working fine for me:

    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin(),
    // create global variables accessible on server and client
    new webpack.DefinePlugin({
like image 361
oshkosh Avatar asked Dec 25 '22 01:12

oshkosh


1 Answers

Because it's not webpack.CommonsChunkPlugin but webpack.optimize.CommonsChunkPlugin

References:

  • https://webpack.github.io/docs/list-of-plugins.html#commonschunkplugin
like image 74
zerkms Avatar answered Jan 02 '23 16:01

zerkms