fix(ivy): ensure @nocollapse is added to static fields (#28050)
ngtsc has a hack to add @nocollapse jsdoc annotations to generated static fields. This hack is currently broken (likely due to a TypeScript change in the way writeFile() works). This commit fixes the hack and introduces an ngtsc_spec test to ensure it does not regress again. PR Close #28050
This commit is contained in:

committed by
Andrew Kushnir

parent
df292c2ce0
commit
61bc61fc59
@ -227,7 +227,7 @@ export class NgtscProgram implements api.Program {
|
||||
if (fileName.endsWith('.d.ts')) {
|
||||
data = sourceFiles.reduce(
|
||||
(data, sf) => this.compilation !.transformedDtsFor(sf.fileName, data), data);
|
||||
} else if (this.closureCompilerEnabled && fileName.endsWith('.ts')) {
|
||||
} else if (this.closureCompilerEnabled && fileName.endsWith('.js')) {
|
||||
data = nocollapseHack(data);
|
||||
}
|
||||
this.host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles);
|
||||
|
Reference in New Issue
Block a user