Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Path Not Transformed If Already Resolvable #190

Open
Char2sGu opened this issue Jun 23, 2024 · 1 comment
Open

Bug: Path Not Transformed If Already Resolvable #190

Char2sGu opened this issue Jun 23, 2024 · 1 comment
Labels
Bug Something isn't working

Comments

@Char2sGu
Copy link

Let's say @workspace/lib is a package in a loal NPM Workspace.
By default, imports will be resolved to node_modules/@workspace/lib, but we can change its resolution by defining the following path mapping:

"paths": {
  "@workspace/lib": "./dist/lib"
}

By doing so, TypeScript will always resolve the path @workspace/lib to {workspaceRoot}/dist/lib instead of {workspaceRoot}/node_modules/@workspace/lib, but this behavior doesn't seem respected in this library: In such case, the path mapping does not take effect, and the path @workspace/lib is not transformed at all.

I will be happy to provide a reproduction repository if you find the above information not descriptive enough.

@Char2sGu
Copy link
Author

Char2sGu commented Jun 23, 2024

Update: the path mapping is respected if @workspace/lib is not present in package.json. This package was listed as a peer dependency to enable auto-imports.

@danielpza danielpza added the Bug Something isn't working label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants