fix(ngcc): handle entry-points within container folders (#36305)
The previous optimizations in #35756 to the `DirectoryWalkerEntryPointFinder` were over zealous with regard to packages that have entry-points stored in "container" directories in the package, where the container directory was not an entry-point itself. Now we will also walk such "container" folders as long as they do not contain `.js` files, which we regard as an indicator that the directory will not contain entry-points. Fixes #36216 PR Close #36305
This commit is contained in:

committed by
Alex Rickabaugh

parent
372b9101e2
commit
38ad1d97ab
@ -156,12 +156,21 @@ export class DirectoryWalkerEntryPointFinder implements EntryPointFinder {
|
||||
isEntryPoint = true;
|
||||
}
|
||||
|
||||
if (!isDirectory || !isEntryPoint) {
|
||||
// This path is not an entry-point directory so we are done
|
||||
if (!isDirectory) {
|
||||
// This path is not a directory so we are done.
|
||||
continue;
|
||||
}
|
||||
|
||||
// This directory may contain entry-points of its own.
|
||||
const childPaths = this.fs.readdir(absolutePath);
|
||||
if (!isEntryPoint &&
|
||||
childPaths.some(
|
||||
childPath => childPath.endsWith('.js') &&
|
||||
this.fs.stat(this.fs.resolve(absolutePath, childPath)).isFile())) {
|
||||
// We do not consider non-entry-point directories that contain JS files as they are very
|
||||
// unlikely to be containers for sub-entry-points.
|
||||
continue;
|
||||
}
|
||||
this.collectSecondaryEntryPoints(entryPoints, packagePath, absolutePath, childPaths);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user