Skip to content

preserveSymlinks doesn't work properly from root package #196

@bterlson

Description

@bterlson

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

  1. Create the above example with mkdir/ln -s
  2. cd into root/mylib/src, run node.exe
  3. 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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions