Skip to content

Commit 722c3cb

Browse files
filipesilvamgechev
authored andcommitted
fix(@ngtools/webpack): only remove decorators in VE (angular#16086)
Fix angular#16070
1 parent bd840b2 commit 722c3cb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/ngtools/webpack/src/angular_compiler_plugin.ts

+5-2
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)