Skip to content

fix(@angular/build): preserve tsconfig custom conditions - #34845

Draft
NginxL wants to merge 1 commit into
angular:mainfrom
NginxL:fix/tsconfig-custom-conditions-34837
Draft

NginxL wants to merge 1 commit into
angular:mainfrom
NginxL:fix/tsconfig-custom-conditions-34837

Conversation

@NginxL

@NginxL NginxL commented Dec 5, 2026

Copy link
Copy Markdown

PR Checklist

  • The commit message follows our guidelines.
  • Tests for the changes have been added.
  • Docs have been added / updated (not applicable).

PR Type

  • Bugfix

What is the current behavior?

When the target's conditions option is unset, transformCompilerOptions overwrites compilerOptions.customConditions with undefined. This drops the conditions from tsconfig, so TypeScript resolution during ng build can differ from tsc and editor/type-aware lint resolution.

Issue: Fixes #34837

What is the new behavior?

An explicit build conditions value continues to take precedence. When it is undefined, the existing tsconfig.customConditions value is preserved. An explicitly configured empty array still clears the inherited list, preserving the ability to disable those conditions.

Added unit coverage for inheritance, override, and explicit clearing.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Validation performed locally:

  • bun ../../check-angular-34837.ts — focused runtime assertions for inheritance, explicit override, and clearing passed.
  • git diff --check — passed.
  • The repository's Bazel/Jasmine target and full application integration test were not run because package dependencies and the Bazel runtime were not available offline.

AI disclosure: this change and PR text were prepared with an AI coding agent. The implementation and focused validation are described above; CI results and review feedback should be used to complete verification.

Use the tsconfig customConditions when the build does not provide an explicit conditions override. An empty conditions array still clears the inherited list.
@google-cla

google-cla Bot commented Dec 5, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Respect or warn about tsconfig customConditions when conditions is not set

1 participant