nodejs / readable-stream

Node-core streams for userland
https://nodejs.org/api/stream.html
Other
1.03k stars 227 forks source link

fix: circumvent issues with ESM process polyfills #543

Open WasabiThumb opened 3 days ago

WasabiThumb commented 3 days ago

Would resolve #539. This is a hacky solution that may preferrably be made obsolete by resolution of davidmyersdev/vite-plugin-node-polyfills#106.

The root issue is that some node:process polyfills export an ES module that is not unwrapped at runtime. This change would introduce a patch that conditionally unwraps the module in the event that checks pass indicating that it is wrapped. Those checks are:

This also inherits the curiosity introduced by #497 where node:process is imported via process/.