Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): correctly set overridden compiler…
Browse files Browse the repository at this point in the history
… option

Previously, we set the options of an incorrect variable.

(cherry picked from commit fc60d22)
  • Loading branch information
alan-agius4 authored and clydin committed May 31, 2023
1 parent cd02475 commit 5bff97d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ' +
Expand Down

0 comments on commit 5bff97d

Please sign in to comment.