Skip to content

Commit 9b593ec

Browse files
committed
Start extension search from config location preferentially to current directory
1 parent 5541571 commit 9b593ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/extensions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ namespace ts {
114114
return cache;
115115

116116
function resolveExtensionNames(): Map<string> {
117-
const currentDirectory = host.getCurrentDirectory ? host.getCurrentDirectory() : "";
117+
const basePath = options.configFilePath || combinePaths(host.getCurrentDirectory ? host.getCurrentDirectory() : "", "tsconfig.json");
118118
const extMap: Map<string> = {};
119119
forEach(extensionNames, name => {
120-
const resolved = resolveModuleName(name, combinePaths(currentDirectory, "tsconfig.json"), options, host, /*loadJs*/true).resolvedModule;
120+
const resolved = resolveModuleName(name, basePath, options, host, /*loadJs*/true).resolvedModule;
121121
if (resolved) {
122122
extMap[name] = resolved.resolvedFileName;
123123
}

0 commit comments

Comments
 (0)