RD7
RD7

Reputation: 708

TypeError: webpackManifestPlugin is not a constructor

My build script is failing after upgrading webpack with the following error:

TypeError: webpackManifestPlugin is not a constructor

looking at my config file which is the source of this error, I could not figure out what is wrong - I do declare it before calling it:

const { webpackManifestPlugin } = require('webpack-manifest-plugin');
.....
new webpackManifestPlugin({...})

What can be wrong?

Upvotes: 16

Views: 14763

Answers (1)

tmhao2005
tmhao2005

Reputation: 17474

Looks like you imported the wrong named export from the package. The right one is WebpackManifestPlugin not webpackManifestPlugin

const { WebpackManifestPlugin } = require('webpack-manifest-plugin');

Upvotes: 31

Related Questions