Consider a library lib with the following file structure:
root
- common
- node_modules
- resolve
- buffer
- mylib
- node_modules
- buffer -> ../../common/node_modules/buffer
- src
- index.js
In other words, a dependency exists from the root library to buffer which is symlinked into a separate folder (similar to how pnpm works).
In this case, resolve doesn't seem to be mapping the symlinked paths to real paths properly.
Repro Steps
- Create the above example with mkdir/ln -s
- cd into root/mylib/src, run node.exe
- import
resolve and observe that resolve('buffer/') returns the symlinked path (root/mylib/node_modules/buffer) instead of the real path (root/common/node_modules/buffer).
Consider a library
libwith the following file structure:In other words, a dependency exists from the root library to
bufferwhich is symlinked into a separate folder (similar to how pnpm works).In this case,
resolvedoesn't seem to be mapping the symlinked paths to real paths properly.Repro Steps
resolveand observe thatresolve('buffer/')returns the symlinked path (root/mylib/node_modules/buffer) instead of the real path (root/common/node_modules/buffer).