Identify duplicate functions across all webpack JS bundles.
- Works across Common chunks & Code Splitted bundles
It uses js-cpa for analysing the duplicates.
npm i --save-dev bundle-duplicates-plugin
// webpack.config.js
const BundleDuplicatesPlugin = require("bundle-duplicates-plugin");
module.exports = {
entry: //...,
output: //...,
plugins: [
new BundleDuplicatesPlugin({
// options
})
]
}
All options as mentioned here
- Custom Repoters to visualize the duplicates across bundle