Skip to content

Commit f503c15

Browse files
devversionthePunderWoman
authored andcommitted
refactor(compiler-cli): parse angularCompilerOptions from bazel options as a fallback (#58637)
This commit is only useful to Google. It fixes that some code relies on `readConfiguration`, but doesn't properly parse Angular compiler options as those are part of `bazelOptions.angularCompilerOptions` if the 1P-generated tsconfig's are used. PR Close #58637
1 parent 715caea commit f503c15

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/compiler-cli/src/perform_compile.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,16 @@ export function readConfiguration(
9393
return parentOptions;
9494
}
9595

96+
// Note: In Google, `angularCompilerOptions` are stored in `bazelOptions`.
97+
// This function typically doesn't run for actual Angular compilations, but
98+
// tooling like Tsurge, or schematics may leverage this helper, so we account
99+
// for this here.
100+
const angularCompilerOptions =
101+
config.angularCompilerOptions ?? config.bazelOptions?.angularCompilerOptions;
102+
96103
// we are only interested into merging 'angularCompilerOptions' as
97104
// other options like 'compilerOptions' are merged by TS
98-
let existingNgCompilerOptions = {...config.angularCompilerOptions, ...parentOptions};
105+
let existingNgCompilerOptions = {...angularCompilerOptions, ...parentOptions};
99106
if (!config.extends) {
100107
return existingNgCompilerOptions;
101108
}

0 commit comments

Comments
 (0)