use readable-stream in the browser
Closed this issue · 6 comments
hugomrdias commented
would you consider a PR to alias 'stream': 'readable-stream'
only for the browser? This way we don't rely on bundlers choosing the polyfill, also webpack 5 will stop doing so.
sindresorhus commented
Sorry, no. That would make it a dependency for Node.js. Something I don't want.
sindresorhus commented
also webpack 5 will stop doing so.
That's not final yet.
hugomrdias commented
a dependency for node ? it would be in the package.json yes but node would still run require('stream')
if we do
"browser": {
"stream": "readable-stream"
},
sindresorhus commented
Yes, but it would have to be in the dependencies
field, which means Node.js users would have to install and waste space on it, even if it's not require()
d.
hugomrdias commented
imo being browser friendly is worth the extra bytes, but i understand. ty