refactor(ngcc): remove private declaration aliases (#34254)
Now that the source to typings matching is able to handle aliasing of exports, there is no need to handle aliases in private declarations analysis. These were originally added to cope when the typings files had to use the name that the original source files used when exporting. PR Close #34254
This commit is contained in:

committed by
Kara Erickson

parent
44034888fc
commit
2ef633ef8b
@ -156,7 +156,7 @@ export class DtsRenderer {
|
||||
// Capture the private declarations that need to be re-exported
|
||||
if (privateDeclarationsAnalyses.length) {
|
||||
privateDeclarationsAnalyses.forEach(e => {
|
||||
if (!e.dtsFrom && !e.alias) {
|
||||
if (!e.dtsFrom) {
|
||||
throw new Error(
|
||||
`There is no typings path for ${e.identifier} in ${e.from}.\n` +
|
||||
`We need to add an export for this class to a .d.ts typings file because ` +
|
||||
|
@ -55,9 +55,7 @@ export class EsmRenderingFormatter implements RenderingFormatter {
|
||||
exportFrom = entryPointBasePath !== basePath ? ` from '${relativePath}'` : '';
|
||||
}
|
||||
|
||||
// aliases should only be added in dts files as these are lost when rolling up dts file.
|
||||
const exportStatement = e.alias && isDtsFile ? `${e.alias} as ${e.identifier}` : e.identifier;
|
||||
const exportStr = `\nexport {${exportStatement}}${exportFrom};`;
|
||||
const exportStr = `\nexport {${e.identifier}}${exportFrom};`;
|
||||
output.append(exportStr);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user