Skip to content

Commit

Permalink
Start extension search from config location preferentially to current…
Browse files Browse the repository at this point in the history
… directory
  • Loading branch information
weswigham committed Aug 8, 2016
1 parent 5541571 commit 9b593ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ namespace ts {
return cache;

function resolveExtensionNames(): Map<string> {
const currentDirectory = host.getCurrentDirectory ? host.getCurrentDirectory() : "";
const basePath = options.configFilePath || combinePaths(host.getCurrentDirectory ? host.getCurrentDirectory() : "", "tsconfig.json");
const extMap: Map<string> = {};
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;
}
Expand Down

0 comments on commit 9b593ec

Please sign in to comment.