@barbuza/duplicate-package-checker-webpack-plugin
v1.2.4
Published
Webpack plugin that warns you when multiple versions of the same package exist in a build.
Downloads
3
Readme
duplicate-package-checker-webpack-plugin
Webpack plugin that warns you when multiple versions of the same package exist in a build.
Why?
It might be possible that a single package gets included multiple times in a Webpack build due to different package versions. This situation may happen without any warning, resulting in extra bloat in your build and may lead to hard-to-find bugs.
This plugin will warn you of such cases to minimize build size and avoid bugs caused by unintended duplicate packages.
Motivation: https://github.com/webpack/webpack/issues/385 and https://github.com/webpack/webpack/issues/646.
Install
npm install duplicate-package-checker-webpack-plugin --save-dev
Configuration
Add the plugin to your webpack config:
var DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
module.exports = {
plugins: [
new DuplicatePackageCheckerPlugin()
]
};
You can also pass an object with configurable options:
new DuplicatePackageCheckerPlugin({
// Also show module that is requiring each duplicate package
verbose: true,
// Ignore these modules
ignore: ["warning", "query-string"]
})