Update packages/sol-resolver/src/resolvers/npm_resolver.ts

Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
This commit is contained in:
Fabio B
2018-12-03 13:35:03 +01:00
committed by GitHub
parent 91397bf8a5
commit 9194537085

View File

@@ -26,7 +26,7 @@ export class NPMResolver extends Resolver {
let currentPath = this._packagePath;
const ROOT_PATH = '/';
while (currentPath !== ROOT_PATH) {
const packagePath = _.isUndefined(packageScope) ? packageName : path.join(packageScope, packageName);
const packagePath = _.isUndefined(packageScopeIfExists) ? packageName : path.join(packageScopeIfExists, packageName);
const lookupPath = path.join(currentPath, 'node_modules', packagePath, pathWithinPackage);
if (fs.existsSync(lookupPath) && fs.lstatSync(lookupPath).isFile()) {
const fileContent = fs.readFileSync(lookupPath).toString();