shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.43k stars 186 forks source link

ManifestPlugin is not a constructor #230

Closed Mati365 closed 3 years ago

Mati365 commented 3 years ago
const ManifestPlugin = require('webpack-manifest-plugin');

new ManifestPlugin

causes the problem

0x78f1935 commented 3 years ago
        const { WebpackManifestPlugin } = require('webpack-manifest-plugin');

        new WebpackManifestPlugin({
            fileName: './manifest.json',
            publicPath: '/static/react/',
        }),

Works for me : )

scott-ln commented 2 years ago

I had this issue just now, and it turned out to be because npm i webpack-manifest-plugin had inexplicably installed version 2.2.0 (why?), which doesn't export the same way. npm i webpack-manifest-plugin@latest installed 4.0.2 and that fixed it. Hope this is of use to anyone else ending up here.

Mahdiyeh commented 2 years ago

webpack-manifest-plugin

I have the version 4.0.2, but still the same issue.

TDZhicaoXie commented 2 years ago

I have the version 4.0.2, but still the same issue.

noeloconnor commented 2 years ago

having the same issues on 4.0.2 as well.

shellscape commented 2 years ago

Honestly people, read the documentation: https://github.com/shellscape/webpack-manifest-plugin#usage

Or check the code: https://github.com/shellscape/webpack-manifest-plugin/blob/master/src/index.ts#L65

Major version updates to packages contain breaking changes. That's semver 101 https://semver.org/