Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Commit

Permalink
fix(@angular-devkit/build-angular): favor project node modules with p…
Browse files Browse the repository at this point in the history
…roject deps
  • Loading branch information
clydin authored and hansl committed May 30, 2018
1 parent 505aac2 commit 6de2e57
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
*/
// tslint:disable
// TODO: cleanup this file, it's copied as is from Angular CLI.

import * as fs from 'fs';
import * as path from 'path';

// Resolve dependencies within the target project.
export function resolveProjectModule(root: string, moduleName: string) {
return require.resolve(moduleName, { paths: [root] });
const rootModules = path.join(root, 'node_modules');
if (fs.existsSync(rootModules)) {
return require.resolve(moduleName, { paths: [rootModules] });
} else {
return require.resolve(moduleName, { paths: [root] });
}
}

// Require dependencies within the target project.
Expand Down

0 comments on commit 6de2e57

Please sign in to comment.