summaryrefslogtreecommitdiff
path: root/cli/tsc/99_main_compiler.js
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-07-10 14:46:25 -0400
committerGitHub <noreply@github.com>2024-07-10 14:46:25 -0400
commita49d0bd10ba2a4745c291f3f413d97396213e4ec (patch)
tree0c63c25304f465e969d2bcfb8bd71df8575c4033 /cli/tsc/99_main_compiler.js
parent4d2d764816d266e42f3b2251248b100abb667c83 (diff)
fix(check): CJS types importing dual ESM/CJS package should prefer CJS types (#24492)
Closes #16370
Diffstat (limited to 'cli/tsc/99_main_compiler.js')
-rw-r--r--cli/tsc/99_main_compiler.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js
index 3e37070a9..4fba5449f 100644
--- a/cli/tsc/99_main_compiler.js
+++ b/cli/tsc/99_main_compiler.js
@@ -731,6 +731,7 @@ delete Object.prototype.__proto__;
/** @type {[string, ts.Extension] | undefined} */
const resolved = ops.op_resolve(
containingFilePath,
+ isCjsCache.has(containingFilePath),
[fileReference.fileName],
)?.[0];
if (resolved) {
@@ -764,6 +765,7 @@ delete Object.prototype.__proto__;
/** @type {Array<[string, ts.Extension] | undefined>} */
const resolved = ops.op_resolve(
base,
+ isCjsCache.has(base),
specifiers,
);
if (resolved) {