fix(ngcc): add reexports only once (#33658)
When ngcc is configured to generate reexports for a package using the `generateDeepReexports` configuration option, it could incorrectly render the reexports as often as the number of compiled classes in the declaration file. This would cause compilation errors due to duplicated declarations. PR Close #33658
This commit is contained in:
@ -96,15 +96,15 @@ export class DtsRenderer {
|
||||
const newStatement = ` static ${declaration.name}: ${typeStr};\n`;
|
||||
outputText.appendRight(endOfClass - 1, newStatement);
|
||||
});
|
||||
|
||||
if (renderInfo.reexports.length > 0) {
|
||||
for (const e of renderInfo.reexports) {
|
||||
const newStatement = `\nexport {${e.symbolName} as ${e.asAlias}} from '${e.fromModule}';`;
|
||||
outputText.appendRight(endOfClass, newStatement);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (renderInfo.reexports.length > 0) {
|
||||
for (const e of renderInfo.reexports) {
|
||||
const newStatement = `\nexport {${e.symbolName} as ${e.asAlias}} from '${e.fromModule}';`;
|
||||
outputText.append(newStatement);
|
||||
}
|
||||
}
|
||||
|
||||
this.dtsFormatter.addModuleWithProvidersParams(
|
||||
outputText, renderInfo.moduleWithProviders, importManager);
|
||||
this.dtsFormatter.addExports(
|
||||
|
Reference in New Issue
Block a user