-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
package.json
import maps not resolved correctly when it points to a directory under outDir
#329
Comments
outDir
package.json
import maps not resolved correctly when it points to a directory under outDir
looks like this is a duplicate of #296, however it got closed without resolving |
This would be a feature request since TS released this after tsx, and this was simply not implemented. As it says in the closing comment, #296 was closed as a duplicate, not because it's resolved; the referenced issue is still open. I think this is a separate issue though. This ticket is about TypeScript customizing Node's import/export map logic to consider tsconfig, whereas #296 is about simply implementing Node's import/export map logic. |
This comment was marked as spam.
This comment was marked as spam.
Please don't comment on closed issues. Especially if you're going to reference one that's open. And also, if you're going to make a claim, please back it. There's an explanation with a screenshot above demonstrating why this particular issue is expected. |
Problem
When
resolvePackageJsonImports
is enabled in tsconfig.json, and they point to somewhere inside theoutDir
directory, TypeScript will resolve the package import as the same file but inside therootDir
directory.However tsx does not, it resolves to the original package import directory, making this behavior inconsistent with typescript
This makes something like
"imports": { "#*": "./dist/*" }
work as expected under TypeScript (point to./src/*
), but makes tsx point to./dist/*
Expected behavior
tsx having behavior consistent with TypeScript and resolving to the corresponding file inside
rootDir
Minimal reproduction URL
https://stackblitz.com/edit/node-9muqn2?file=REPRO-INSTRUCTIONS.md&view=editor
Version
v3.13.0
Node.js version
v20.7.0
Package manager
pnpm
Operating system
Windows
Contributions
The text was updated successfully, but these errors were encountered: