diff --git a/src/compiler/extensions.ts b/src/compiler/extensions.ts index 071d3e7f3ec3d..8f2d07b3d7af7 100644 --- a/src/compiler/extensions.ts +++ b/src/compiler/extensions.ts @@ -114,10 +114,10 @@ namespace ts { return cache; function resolveExtensionNames(): Map { - const currentDirectory = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; + const basePath = options.configFilePath || combinePaths(host.getCurrentDirectory ? host.getCurrentDirectory() : "", "tsconfig.json"); const extMap: Map = {}; forEach(extensionNames, name => { - const resolved = resolveModuleName(name, combinePaths(currentDirectory, "tsconfig.json"), options, host, /*loadJs*/true).resolvedModule; + const resolved = resolveModuleName(name, basePath, options, host, /*loadJs*/true).resolvedModule; if (resolved) { extMap[name] = resolved.resolvedFileName; }