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 55 * Use of this source code is governed by an MIT-style license that can be
66 * found in the LICENSE file at https://angular.io/license
77 */
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' ;
129
1310// Resolve dependencies within the target project.
1411export 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+ ) ;
2120}
2221
2322// Require dependencies within the target project.
You can’t perform that action at this time.
0 commit comments