Regression in v0.19 when using relative imports and paths from tsconfig #3354
Closed
Description
I believe this may be related to other issues, but haven't seen a minimal reproduction expressed elsewhere:
Expected output - v0.18.20 processes relative import correctly
Regression - v0.19 resolves the relative import incorrectly
The most relevant pieces to this reproduction are:
- Including a wildcard in
compilerOptions.paths
- Using a relative import which could be resolved by a path-relative import
{
"compilerOptions": {
"paths": {
"*": ["web/*"]
}
}
// web/bar/foo/index.ts
// This relative import is problematic in v0.19 since it resolves to `web/foo` rather than `web/bar/foo`
export {foo} from './foo'
The output in v0.19
translates the example into a recursive function since web/bar/foo/index.ts
is masked by web/foo.ts
// web/foo.ts
function foo() {
console.log("web/foo");
foo(); // <- this is the wrong function reference
}
// entry.ts
foo();
- I believe this regression was introduced in the resolution to
--packages=external
option affects local files mapped bytsconfig.json
'spaths
option #3238