Registry /
devops / duplicate-dependencies-webpack-plugin
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DuplicateReporterPlugin
✓ import { DuplicateReporterPlugin } from 'duplicate-dependencies-webpack-plugin'
✗ const { DuplicateReporterPlugin } = require('duplicate-dependencies-webpack-plugin')
Named export; use destructured import or require. ESM and CJS both supported.
default import
✓ import DuplicatePlugin from 'duplicate-dependencies-webpack-plugin'
✗ const DuplicatePlugin = require('duplicate-dependencies-webpack-plugin').default
Default export is the plugin constructor; in CJS, require returns the same as default export.
getHooks
✓ import DuplicatePlugin from 'duplicate-dependencies-webpack-plugin'; DuplicatePlugin.getHooks(compilation)
✗ DuplicatePlugin.getHooks // do not call statically without compilation
getHooks is a static method on the plugin class, requires compilation object from webpack.
Minimal webpack config adding DuplicateReporterPlugin to detect duplicate dependencies in output.
const { DuplicateReporterPlugin } = require('duplicate-dependencies-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: { filename: 'bundle.js' },
plugins: [new DuplicateReporterPlugin()]
};
Errors
Common errors & fixes
TypeError: DuplicateReporterPlugin is not a constructor
Incorrect import or usage of DuplicateReporterPlugin as default export without destructuring.
fixUse const { DuplicateReporterPlugin } = require('duplicate-dependencies-webpack-plugin') or const Plugin = require('duplicate-dependencies-webpack-plugin'); new Plugin() Error: Cannot find module 'duplicate-dependencies-webpack-plugin'
Plugin not installed.
fixRun npm install duplicate-dependencies-webpack-plugin --save-dev
Audit
Dependencies
No dependency data recorded yet.