In my bundle, the same node_modules/bn.js/lib
dependency is included 8 times in my production bundle.
Any idea why and how to prevent it?
In this case, I was able to add a resolve.alias
to my config.
const p = require('path')
module.exports = {
resolve: {
alias: {
'bn.js': p.join(__dirname, 'node_modules/bn.js/lib/bn.js'),
}
},
// ...
}
Not sure if that's the right way, but it's no longer duplicated in my bundle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With