Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: webpackManifestPlugin is not a constructor

Tags:

webpack

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?

like image 912
RD7 Avatar asked Jan 15 '21 11:01

RD7


1 Answers

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

const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
like image 186
tmhao2005 Avatar answered Sep 19 '22 14:09

tmhao2005