File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -97,10 +97,15 @@ export class NgccProcessor {
97
97
*/
98
98
private tryResolvePackage ( moduleName : string , resolvedFileName : string ) : string | undefined {
99
99
try {
100
+ let packageJsonPath = path . resolve ( resolvedFileName , '../package.json' ) ;
101
+ if ( existsSync ( packageJsonPath ) ) {
102
+ return packageJsonPath ;
103
+ }
104
+
100
105
// This is based on the logic in the NGCC compiler
101
106
// tslint:disable-next-line:max-line-length
102
107
// See: https://github.com/angular/angular/blob/b93c1dffa17e4e6900b3ab1b9e554b6da92be0de/packages/compiler-cli/src/ngcc/src/packages/dependency_host.ts#L85-L121
103
- const packageJsonPath = require . resolve ( `${ moduleName } /package.json` ,
108
+ packageJsonPath = require . resolve ( `${ moduleName } /package.json` ,
104
109
{
105
110
paths : [ resolvedFileName ] ,
106
111
} ,
You can’t perform that action at this time.
0 commit comments