Commit a737d76
committed
vfs: remove duplicated module resolution logic from setup.js
Remove ~550 lines of duplicated module resolution functions that
reimplemented canonical Node.js resolver behavior (extension trying,
package exports resolution, bare specifier walking, directory entry
resolution, format detection). The canonical resolvers already consult
VFS through the loader overrides installed by installModuleLoaderOverrides(),
making the Module.registerHooks() resolve/load hooks redundant.
Also add clearStatCache() to the CJS loader, called on VFS unmount to
prevent stale stat cache entries from causing incorrect resolution after
a VFS is deregistered.1 parent 386ec3e commit a737d76
File tree
3 files changed
+28
-701
lines changed- lib/internal
- modules/cjs
- vfs
- test/parallel
3 files changed
+28
-701
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
232 | 243 | | |
233 | 244 | | |
234 | 245 | | |
| |||
0 commit comments