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-pluginVerified import paths — ran on the pinned version, not inferred.
Shows how to configure and use WebpackDeduplicationPlugin in webpack.config.js with cacheDir and rootPath.
Test thoroughly in your project; contribute fixes if issues arise.
Manually delete cacheDir when yarn.lock changes or dependencies update.
Use only with webpack 4+; check compatibility with your webpack version.
Ensure plugin is added to plugins array after other plugins that modify compiler context, or set rootPath explicitly.
Provide correct rootPath or ensure a yarn.lock file exists at the root; plugin currently only supports yarn.
Install app-root-path as a dev dependency or provide rootPath explicitly.