Make file as externalLibrary import if path contains node_modules

This commit is contained in:
Sheetal Nandi
2018-08-14 16:21:22 -07:00
parent a32f62b310
commit 1dd3cd288e
4 changed files with 2 additions and 21 deletions

View File

@@ -769,7 +769,7 @@ namespace ts {
const loader: ResolutionKindSpecificLoader = (extensions, candidate, failedLookupLocations, onlyRecordFailures, state) => nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ true);
const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state);
if (resolved) {
return toSearchResult({ resolved, isExternalLibraryImport: false });
return toSearchResult({ resolved, isExternalLibraryImport: resolved.path.indexOf("/node_modules/") !== -1 });
}
if (!isExternalModuleNameRelative(moduleName)) {