@barbuza/duplicate-package-checker-webpack-plugin

1.2.4 • Public • Published

duplicate-package-checker-webpack-plugin

NPM version Downloads Build Status

Webpack plugin that warns you when multiple versions of the same package exist in a build.

duplicate-package-checker-webpack-plugin

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"]
})

Readme

Keywords

Package Sidebar

Install

npm i @barbuza/duplicate-package-checker-webpack-plugin

Weekly Downloads

3

Version

1.2.4

License

MIT

Last publish

Collaborators

  • barbuza