Skip to content

Commit 9eba2cc

Browse files
committed
fix(@ngtools/webpack): only remove decorators in VE
Fix angular#16070
1 parent da6d74a commit 9eba2cc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/ngtools/webpack/src/angular_compiler_plugin.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,8 +981,11 @@ export class AngularCompilerPlugin {
981981
// This is required to support forwardRef in ES2015 due to TDZ issues
982982
this._transformers.push(downlevelConstructorParameters(getTypeChecker));
983983
} else {
984-
// Remove unneeded angular decorators.
985-
this._transformers.push(removeDecorators(isAppPath, getTypeChecker));
984+
if (!this._compilerOptions.enableIvy) {
985+
// Remove unneeded angular decorators in VE.
986+
// In Ivy they are removed in ngc directly.
987+
this._transformers.push(removeDecorators(isAppPath, getTypeChecker));
988+
}
986989
// Import ngfactory in loadChildren import syntax
987990
if (this._useFactories) {
988991
// Only transform imports to use factories with View Engine.

0 commit comments

Comments
 (0)