Skip to content

Path resolution has too many .. when paths does not stem from project dir #49

@joergplewe

Description

@joergplewe

What I try to do: Use some TS code somewhere in my project tree as a library by referring it by a paths mapping.

It seems that path resolution goes wrong when a paths reference does not stem from the project dir (where tsconfig.json is), e.g. has a .. in it.
Like this:

 "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@lib/*": ["./../lib/src/*"]
    },
    "outDir": "./dist",

In this case, the resolved path has one .. too much.

This also holds when shifting the baseUrl up:

 "compilerOptions": {
    "baseUrl": "./../",
    "paths": {
      "@lib/*": ["./lib/src/*"]
    },
    "outDir": "./dist",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions