package.json
import maps not resolved correctly when it points to a directory under outDir
#329
Labels
package.json
import maps not resolved correctly when it points to a directory under outDir
#329
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: