Registry / devops / webpack-deduplication-plugin

webpack-deduplication-plugin

JSON →
library0.0.8jsnpmunverified

Webpack plugin that deduplicates transitive dependencies in yarn and webpack-based projects. Version 0.0.8 (stable, low release cadence) by Atlassian Labs. Uses content-based caching via yarn.lock to avoid duplicate modules. Differentiator: targeted at monorepo or complex dependency trees where multiple versions of the same package are bundled, reducing bundle size. Compared to alternatives like DedupePlugin, this plugin persists cache across builds and integrates tightly with yarn workspace resolution. Currently in early development; lacking documentation and tests.

npm install webpack-deduplication-plugin
INSTALL
IMPORT
SIG · WEBPACK-DEDUPLICAT
W
webpack-deduplication-plugin
devopsjavascriptv0.0.8
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WebpackDeduplicationPlugin
✓ import { WebpackDeduplicationPlugin } from 'webpack-deduplication-plugin'
✗ const WebpackDeduplicationPlugin = require('webpack-deduplication-plugin').default
Package exports a named export, not a default. CommonJS require with named destructuring works too: const { WebpackDeduplicationPlugin } = require('...')

Shows how to configure and use WebpackDeduplicationPlugin in webpack.config.js with cacheDir and rootPath.

// webpack.config.js const path = require('path'); const { WebpackDeduplicationPlugin } = require('webpack-deduplication-plugin'); const cacheDirPath = path.resolve(__dirname, '.cache/webpack-deduplication'); const rootPath = path.resolve(__dirname, '.'); module.exports = { context: __dirname, entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js', }, plugins: [ new WebpackDeduplicationPlugin({ cacheDir: cacheDirPath, rootPath: rootPath, }), ], };
Debug
Known issues
gotchaPlugin is experimental; may not handle all edge cases in dependency deduplication.
fix
Test thoroughly in your project; contribute fixes if issues arise.
affects: >=0.0.1
gotchacacheDir is not cleaned automatically; stale cache may cause incorrect deduplication after dependency changes.
fix
Manually delete cacheDir when yarn.lock changes or dependencies update.
affects: >=0.0.1
gotchaPlugin requires webpack 4 or 5; not tested with other bundlers.
fix
Use only with webpack 4+; check compatibility with your webpack version.
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: Cannot read property 'context' of undefined
WebpackDeduplicationPlugin expects a webpack compiler object with context; misconfigured plugin order.
fix
Ensure plugin is added to plugins array after other plugins that modify compiler context, or set rootPath explicitly.
Error: ENOENT: no such file or directory, open '.../yarn.lock'
Plugin cannot find yarn.lock because rootPath is incorrect or project uses npm/pnpm.
fix
Provide correct rootPath or ensure a yarn.lock file exists at the root; plugin currently only supports yarn.
Module not found: Error: Can't resolve 'app-root-path'
app-root-path is an optional dependency; if missing and rootPath not provided, plugin throws.
fix
Install app-root-path as a dev dependency or provide rootPath explicitly.
Upgrade
Version history
0.0.8latest on npm
Audit
Dependencies
app-root-pathoptionalUsed to auto-detect project root if not provided
Agent activity
8 hits · last 30 days
node
8
Resources
webpack-deduplication-plugin — npm install webpack-deduplication-plugin · libregistry