You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vfs: replace fs monkey-patching with toggleable loader wrappers
Add loaderStat(), loaderReadFile(), and setLoaderFsOverrides() to
helpers.js, and modify toRealPath() to support a VFS toggle. Replace
direct internalFsBinding.internalModuleStat() and fs.readFileSync()
calls in the CJS loader, ESM resolver, ESM loader, translators, and
package_json_reader with these wrappers.
The VFS module_hooks.js now calls setLoaderFsOverrides() first in
installHooks(), making loader fs interception order-independent and
eliminating conflicts with cached fs method references.
Fix two pre-existing bugs in esm/resolve.js finalizeResolution():
- StringPrototypeEndsWith() was called with internalFsBinding as
first arg instead of path
- StringPrototypeSlice(path, -1) returned the last char instead of
stripping the trailing slash (now correctly uses path, 0, -1)
Existing fs patches for user-facing operations are kept unchanged.
0 commit comments