File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
packages/angular_devkit/build_angular/src/angular-cli-files/utilities Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 5
5
* Use of this source code is governed by an MIT-style license that can be
6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
- // tslint:disable
9
- // TODO: cleanup this file, it's copied as is from Angular CLI.
10
- import * as fs from 'fs' ;
11
- import * as path from 'path' ;
8
+ import { resolve } from '@angular-devkit/core/node' ;
12
9
13
10
// Resolve dependencies within the target project.
14
11
export function resolveProjectModule ( root : string , moduleName : string ) {
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
- }
12
+ return resolve (
13
+ moduleName ,
14
+ {
15
+ basedir : root ,
16
+ checkGlobal : false ,
17
+ checkLocal : true ,
18
+ } ,
19
+ ) ;
21
20
}
22
21
23
22
// Require dependencies within the target project.
You can’t perform that action at this time.
0 commit comments