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
@ -287,6 +287,22 @@ runInEachFileSystem(() => {
|
||||
expect(entryPoints).toEqual([]);
|
||||
});
|
||||
|
||||
it('should process sub-entry-points within a non-entry-point containing folder in a package',
|
||||
() => {
|
||||
const basePath = _Abs('/containing_folders/node_modules');
|
||||
loadTestFiles([
|
||||
...createPackage(basePath, 'package'),
|
||||
...createPackage(fs.resolve(basePath, 'package/container'), 'entry-point-1'),
|
||||
]);
|
||||
const finder = new DirectoryWalkerEntryPointFinder(
|
||||
fs, config, logger, resolver, manifest, basePath, undefined);
|
||||
const {entryPoints} = finder.findEntryPoints();
|
||||
expect(dumpEntryPointPaths(basePath, entryPoints)).toEqual([
|
||||
['package', 'package'],
|
||||
['package', 'package/container/entry-point-1'],
|
||||
]);
|
||||
});
|
||||
|
||||
it('should handle dependencies via pathMappings', () => {
|
||||
const basePath = _Abs('/path_mapped/node_modules');
|
||||
const pathMappings: PathMappings = {
|
||||
|
Reference in New Issue
Block a user