Skip to content

May fail with symlinks #107

Closed
Closed
@nonara

Description

@nonara

In looking into TS compiler's resolver code, I have discovered an internal property called originalPath in the ResolvedModuleFull type returned by the resolveModuleName API function. This is the function we rely on to get our resolved path for output.

Looking further into the code, it seems that the originalPath value is set when the compilerOptions.preserveSymlinks option is false in tsconfig.json and the resolved module is a symlink.

At present, if a resolved module is a symlink, our transformer output will use the symlink path as opposed to the original, which could cause issues. To mitigate, we should prefer originalPath (when it is available) to avoid this issue.

Simply put, this will keep us from "following" symlinks during our own resolution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions