fix(compiler): automatically set emitDecoratorMetadata
when "annotationsAs": "static fields”
(#19927)
This is a workaround for https://github.com/angular/tsickle/issues/635. Fixes #19916 PR Close #19927
This commit is contained in:

committed by
Matias Niemelä

parent
56b18ff063
commit
d56724659f
@ -45,6 +45,12 @@ function createEmitCallback(options: api.CompilerOptions): api.TsEmitCallback|un
|
||||
if (!transformDecorators && !transformTypesToClosure) {
|
||||
return undefined;
|
||||
}
|
||||
if (transformDecorators) {
|
||||
// This is needed as a workaround for https://github.com/angular/tsickle/issues/635
|
||||
// Otherwise tsickle might emit references to non imported values
|
||||
// as TypeScript elided the import.
|
||||
options.emitDecoratorMetadata = true;
|
||||
}
|
||||
const tsickleHost: tsickle.TsickleHost = {
|
||||
shouldSkipTsickleProcessing: (fileName) =>
|
||||
/\.d\.ts$/.test(fileName) || GENERATED_FILES.test(fileName),
|
||||
|
Reference in New Issue
Block a user