File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/angular_devkit/build_angular/src/angular-cli-files/utilities Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 7
7
*/
8
8
// tslint:disable
9
9
// TODO: cleanup this file, it's copied as is from Angular CLI.
10
-
10
+ import * as fs from 'fs' ;
11
+ import * as path from 'path' ;
11
12
12
13
// Resolve dependencies within the target project.
13
14
export function resolveProjectModule ( root : string , moduleName : string ) {
14
- return require . resolve ( moduleName , { paths : [ root ] } ) ;
15
+ const rootModules = path . join ( root , 'node_modules' ) ;
16
+ if ( fs . existsSync ( rootModules ) ) {
17
+ return require . resolve ( moduleName , { paths : [ rootModules ] } ) ;
18
+ } else {
19
+ return require . resolve ( moduleName , { paths : [ root ] } ) ;
20
+ }
15
21
}
16
22
17
23
// Require dependencies within the target project.
You can’t perform that action at this time.
0 commit comments