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:
require("node:process")["__esModule"] === true
Intent is to quickly eliminate false positives
"nextTick" in require("node:process")["default"] || "nextTick" in require("node:process")["process"]
Indicates that the default or process property of the import is indeed intended to polyfill node:process. The choice of nextTick here is arbitrary, however the method would be required for proper function of this package.
This also inherits the curiosity introduced by #497 where node:process is imported via process/.
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:require("node:process")["__esModule"] === true
"nextTick" in require("node:process")["default"] || "nextTick" in require("node:process")["process"]
default
orprocess
property of the import is indeed intended to polyfillnode:process
. The choice ofnextTick
here is arbitrary, however the method would be required for proper function of this package.This also inherits the curiosity introduced by #497 where
node:process
is imported viaprocess/
.