From 9b593ec8f2ea569fd33196fd75315fbe7a6bd23e Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 8 Aug 2016 16:10:10 -0700 Subject: [PATCH] Start extension search from config location preferentially to current directory --- src/compiler/extensions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }