From fc60d2227672f8276255f95be135923c4d82b75c Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 31 May 2023 13:48:25 +0000 Subject: [PATCH] fix(@angular-devkit/build-angular): correctly set overridden compiler option Previously, we set the options of an incorrect variable. --- .../build_angular/src/webpack/plugins/typescript.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/angular_devkit/build_angular/src/webpack/plugins/typescript.ts b/packages/angular_devkit/build_angular/src/webpack/plugins/typescript.ts index 43247ee2e748..60e1ae51f93c 100644 --- a/packages/angular_devkit/build_angular/src/webpack/plugins/typescript.ts +++ b/packages/angular_devkit/build_angular/src/webpack/plugins/typescript.ts @@ -26,11 +26,11 @@ export function createIvyPlugin( }; if (tsConfig.options.target === undefined || tsConfig.options.target < ScriptTarget.ES2022) { - tsConfig.options.target = ScriptTarget.ES2022; + compilerOptions.target = ScriptTarget.ES2022; // If 'useDefineForClassFields' is already defined in the users project leave the value as is. // Otherwise fallback to false due to https://github.com/microsoft/TypeScript/issues/45995 // which breaks the deprecated `@Effects` NGRX decorator and potentially other existing code as well. - tsConfig.options.useDefineForClassFields ??= false; + compilerOptions.useDefineForClassFields ??= false; wco.logger.warn( 'TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and ' +