prundupify
is a browserify plugin which removes
duplicate files in the build completly.
Warning: This might break your code if you are relying on the module cache to be different for different files which has exatcly the same source. Please see the example below.
a.js:
module.exports = Math.random()
b.js:
module.exports = Math.random()
entry.js:
console.log(require('./a') === require('./b'))
$ browserify entry.js | node
false
$ browserify entry.js -p prundupify | node
true
npm install -S prundupify
MIT