fix(compiler): do not autoinclude components declared as entry points (#10898)
This commit is contained in:
@ -388,11 +388,8 @@ export class CompileMetadataResolver {
|
||||
});
|
||||
moduleMeta.entryComponents.forEach((entryComponentType) => {
|
||||
if (!moduleMeta.transitiveModule.directivesSet.has(entryComponentType.runtime)) {
|
||||
this._addDirectiveToModule(
|
||||
this.getDirectiveMetadata(entryComponentType.runtime), moduleMeta.type.runtime,
|
||||
moduleMeta.transitiveModule, moduleMeta.declaredDirectives);
|
||||
this._console.warn(
|
||||
`NgModule ${stringify(moduleMeta.type.runtime)} uses ${stringify(entryComponentType.runtime)} via "entryComponents" but it was neither declared nor imported! This warning will become an error after final.`);
|
||||
throw new BaseException(
|
||||
`NgModule ${stringify(moduleMeta.type.runtime)} uses ${stringify(entryComponentType.runtime)} via "entryComponents" but it was neither declared nor imported! If ${stringify(entryComponentType.runtime)} is declared in an imported module, make sure it is exported.`);
|
||||
}
|
||||
});
|
||||
// Collect @Component.directives/pipes/entryComponents into our declared
|
||||
|
Reference in New Issue
Block a user