René's URL Explorer Experiment


Title: fix(@angular/build): respect tsconfig customConditions in unit-test builder by RobbyRabbitman · Pull Request #33246 · angular/angular-cli · GitHub

Open Graph Title: fix(@angular/build): respect tsconfig customConditions in unit-test builder by RobbyRabbitman · Pull Request #33246 · angular/angular-cli

X Title: fix(@angular/build): respect tsconfig customConditions in unit-test builder by RobbyRabbitman · Pull Request #33246 · angular/angular-cli

Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type What kind of change does this PR introduce? Bugfix Feature Code style update (formatting, local variables) Refactoring (no functional changes, no api changes) Build related changes CI related changes Documentation content changes Other... Please describe: What is the current behavior? When @angular/build:unit-test is configured with an @angular/build:ng-packagr build target, the synthesized application-builder build never receives the test tsconfig's compilerOptions.customConditions. Module resolution therefore diverges from ng build, which honors customConditions natively through ng-packagr: transformNgPackagrOptions() only forwards stylePreprocessorOptions, assets and inlineStyleLanguage from ng-package.json; ng-packagr's schema has no conditions field, so nothing is carried over. The synthesized ApplicationBuilderInternalOptions is then handed to buildApplicationInternal() without conditions, so esbuild resolves library imports with only the default conditions (module, development/production, plus browser/node). The Vitest runner's resolve.conditions was hardcoded to ['es2015', 'es2020', 'module', (browser)], also ignoring custom conditions. Concrete impact: monorepo setups that use customConditions (e.g. a source condition) to redirect workspace library imports to local TypeScript sources during development work as expected for ng build, but ng test silently falls back to the published entry points — defeating the purpose of source‑mapped local development and making library tests harder to debug. Issue Number: N/A What is the new behavior? The unit-test builder now reads compilerOptions.customConditions from the test tsconfig (following the extends chain via the TypeScript config parser) and: forwards them as conditions into the synthesized application-builder options, but only when the build target did not already set conditions. This preserves the existing application-builder behavior, including explicit opt‑outs (conditions: []) and user-supplied lists. appends them to Vite's resolve.conditions in the Vitest plugin, so the runner's own resolver matches the build-time resolution. No schema changes and no public API surface changes; the new behavior is opt‑in via the existing compilerOptions.customConditions tsconfig field (TS 5.0+). A new integration spec at packages/angular/build/src/builders/unit-test/tests/options/conditions_spec.ts locks the behavior in with two cases: Positive – with customConditions: ['staging'] in tsconfig.spec.json and a #target imports map that exposes the good source only under the staging condition, the spec resolves to the good source and passes. Negative regression guard – same target mapping but no customConditions declared; the spec must fall back to the default (bad) target, proving the new behavior is opt‑in and does not inject unrelated conditions. Does this PR introduce a breaking change? Yes No The new behavior only activates when compilerOptions.customConditions is present in the test tsconfig — a field most projects do not set today. For @angular/build:application build targets that explicitly set conditions, that value is preserved (the backfill is guarded by conditions === undefined). For ng-packagr targets, this brings ng test into parity with ng build, which is a convergence rather than a divergence. Other information Files changed: packages/angular/build/src/builders/unit-test/options.ts — read customConditions from the test tsconfig via ts.parseJsonConfigFileContent (extends‑aware) and expose it on the normalized options. packages/angular/build/src/builders/unit-test/builder.ts — backfill conditions into the application-builder options only when the build target did not set it. packages/angular/build/src/builders/unit-test/runners/vitest/executor.ts — thread customConditions through to the Vitest config plugin. packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts — append customConditions to Vite's resolve.conditions. packages/angular/build/src/builders/unit-test/tests/options/conditions_spec.ts — new integration spec. The Karma runner intentionally was not touched: it does not share the Vite resolver code path, and forwarding conditions through the application build it consumes is already covered by the same builder.ts change.](#33246)

Open Graph Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-comm...

X Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-comm...

Opengraph URL: https://github.com/angular/angular-cli/pull/33246

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ff1c865a-2118-83af-65ed-5ac22a09989e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA730:2D3AF3:257E06:3468A2:6A630161
html-safe-nonceb55aa51cfb5d902cae321361e6ac2b0a1c59e9a03e0c020c4c50a405659d78a9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzMwOjJEM0FGMzoyNTdFMDY6MzQ2OEEyOjZBNjMwMTYxIiwidmlzaXRvcl9pZCI6Ijg5NzU0MjIyMTk0MzE5MDM1ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac93a6212c66e63616269cbf132107c351021508e9c290ee64507baf39d71e1816
hovercard-subject-tagpull_request:3734787432
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/angular/angular-cli/pull/33246/files
twitter:imagehttps://avatars.githubusercontent.com/u/54601487?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/54601487?s=400&v=4
og:image:altPR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-comm...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None14517cd57568049be7ed25bfe9708f10d1e36b7254adfd920dfb9d44bcc71c41
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4b2ed33e3827bc186c45c037f9274b5493aaca4c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/pull/33246/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fpull%2F33246%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fpull%2F33246%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/pull/33246/files
Reloadhttps://github.com/angular/angular-cli/pull/33246/files
Reloadhttps://github.com/angular/angular-cli/pull/33246/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/33246/files
angular https://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Notifications https://github.com/login?return_to=%2Fangular%2Fangular-cli
Fork 11.9k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Star 27k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Code https://github.com/angular/angular-cli
Issues 269 https://github.com/angular/angular-cli/issues
Pull requests 29 https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security and quality 5 https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
Code https://github.com/angular/angular-cli
Issues https://github.com/angular/angular-cli/issues
Pull requests https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security and quality https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangular-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangular-cli%2Fissues%2Fnew%2Fchoose
RobbyRabbitmanhttps://github.com/RobbyRabbitman
angular:mainhttps://github.com/angular/angular-cli/tree/main
RobbyRabbitman:fix/unit-test-custom-conditionshttps://github.com/RobbyRabbitman/angular-cli/tree/fix/unit-test-custom-conditions
Conversation 3 https://github.com/angular/angular-cli/pull/33246
Commits 1 https://github.com/angular/angular-cli/pull/33246/commits
Checks 9 https://github.com/angular/angular-cli/pull/33246/checks
Files changed https://github.com/angular/angular-cli/pull/33246/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/33246/files
fix(@angular/build): respect tsconfig customConditions in unit-test builder https://github.com/angular/angular-cli/pull/33246/files#top
Show all changes 1 commit https://github.com/angular/angular-cli/pull/33246/files
34a4902 fix(@angular/build): respect tsconfig customConditions in unit-test b… May 23, 2026 https://github.com/angular/angular-cli/pull/33246/commits/34a4902d2839ea1f35aa28363756319c8190abe2
Clear filters https://github.com/angular/angular-cli/pull/33246/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/33246/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/33246/files
builder.ts https://github.com/angular/angular-cli/pull/33246/files#diff-09f2afd87c4f68d4db16b9167cf520ee7579712ce0a72de7a9670319f712e2d5
options.ts https://github.com/angular/angular-cli/pull/33246/files#diff-34f21a5749146954abd3fb93a48806f5c521e8c00dd40f276d9be0ebee549c5b
executor.ts https://github.com/angular/angular-cli/pull/33246/files#diff-505d61ac7a20948fa9b112ddfd72cfff2aa8bb759e9c81d55df876be423cdc01
plugins.ts https://github.com/angular/angular-cli/pull/33246/files#diff-cde92e3443c29be0e9b93f3db73e39989edd8a50cbba24b46e868df35ba391f7
conditions_spec.ts https://github.com/angular/angular-cli/pull/33246/files#diff-f9538385a881e91028187eedf0d983e292aa2b21683ff60f55469970ce01fbe7
packages/angular/build/src/builders/unit-test/builder.tshttps://github.com/angular/angular-cli/pull/33246/files#diff-09f2afd87c4f68d4db16b9167cf520ee7579712ce0a72de7a9670319f712e2d5
View file https://github.com/angular/angular-cli/blob/34a4902d2839ea1f35aa28363756319c8190abe2/packages/angular/build/src/builders/unit-test/builder.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/33246/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/33246/files#diff-09f2afd87c4f68d4db16b9167cf520ee7579712ce0a72de7a9670319f712e2d5
https://github.com/angular/angular-cli/pull/33246/files#diff-09f2afd87c4f68d4db16b9167cf520ee7579712ce0a72de7a9670319f712e2d5
packages/angular/build/src/builders/unit-test/options.tshttps://github.com/angular/angular-cli/pull/33246/files#diff-34f21a5749146954abd3fb93a48806f5c521e8c00dd40f276d9be0ebee549c5b
View file https://github.com/angular/angular-cli/blob/34a4902d2839ea1f35aa28363756319c8190abe2/packages/angular/build/src/builders/unit-test/options.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/33246/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/33246/files#diff-34f21a5749146954abd3fb93a48806f5c521e8c00dd40f276d9be0ebee549c5b
https://github.com/angular/angular-cli/pull/33246/files#diff-34f21a5749146954abd3fb93a48806f5c521e8c00dd40f276d9be0ebee549c5b
gemini-code-assisthttps://github.com/apps/gemini-code-assist
May 23, 2026https://github.com/angular/angular-cli/pull/33246/files#r3292728493
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://camo.githubusercontent.com/32601710f6703a1d3cdbb05c7f9f05d1d8c88abc4d4e4d4e25ff218874a45279/68747470733a2f2f7777772e677374617469632e636f6d2f636f64657265766965776167656e742f6d656469756d2d7072696f726974792e737667
Please reload this pagehttps://github.com/angular/angular-cli/pull/33246/files
https://github.com/angular/angular-cli/pull/33246/files#diff-34f21a5749146954abd3fb93a48806f5c521e8c00dd40f276d9be0ebee549c5b
https://github.com/angular/angular-cli/pull/33246/files#diff-34f21a5749146954abd3fb93a48806f5c521e8c00dd40f276d9be0ebee549c5b
https://github.com/angular/angular-cli/pull/33246/files#diff-34f21a5749146954abd3fb93a48806f5c521e8c00dd40f276d9be0ebee549c5b
https://github.com/angular/angular-cli/pull/33246/files#diff-34f21a5749146954abd3fb93a48806f5c521e8c00dd40f276d9be0ebee549c5b
https://github.com/angular/angular-cli/pull/33246/files#diff-34f21a5749146954abd3fb93a48806f5c521e8c00dd40f276d9be0ebee549c5b
packages/angular/build/src/builders/unit-test/runners/vitest/executor.tshttps://github.com/angular/angular-cli/pull/33246/files#diff-505d61ac7a20948fa9b112ddfd72cfff2aa8bb759e9c81d55df876be423cdc01
View file https://github.com/angular/angular-cli/blob/34a4902d2839ea1f35aa28363756319c8190abe2/packages/angular/build/src/builders/unit-test/runners/vitest/executor.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/33246/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/33246/files#diff-505d61ac7a20948fa9b112ddfd72cfff2aa8bb759e9c81d55df876be423cdc01
https://github.com/angular/angular-cli/pull/33246/files#diff-505d61ac7a20948fa9b112ddfd72cfff2aa8bb759e9c81d55df876be423cdc01
packages/angular/build/src/builders/unit-test/runners/vitest/plugins.tshttps://github.com/angular/angular-cli/pull/33246/files#diff-cde92e3443c29be0e9b93f3db73e39989edd8a50cbba24b46e868df35ba391f7
View file https://github.com/angular/angular-cli/blob/34a4902d2839ea1f35aa28363756319c8190abe2/packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/33246/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/33246/files#diff-cde92e3443c29be0e9b93f3db73e39989edd8a50cbba24b46e868df35ba391f7
https://github.com/angular/angular-cli/pull/33246/files#diff-cde92e3443c29be0e9b93f3db73e39989edd8a50cbba24b46e868df35ba391f7
https://github.com/angular/angular-cli/pull/33246/files#diff-cde92e3443c29be0e9b93f3db73e39989edd8a50cbba24b46e868df35ba391f7
https://github.com/angular/angular-cli/pull/33246/files#diff-cde92e3443c29be0e9b93f3db73e39989edd8a50cbba24b46e868df35ba391f7
https://github.com/angular/angular-cli/pull/33246/files#diff-cde92e3443c29be0e9b93f3db73e39989edd8a50cbba24b46e868df35ba391f7
https://github.com/angular/angular-cli/pull/33246/files#diff-cde92e3443c29be0e9b93f3db73e39989edd8a50cbba24b46e868df35ba391f7
packages/angular/build/src/builders/unit-test/tests/options/conditions_spec.tshttps://github.com/angular/angular-cli/pull/33246/files#diff-f9538385a881e91028187eedf0d983e292aa2b21683ff60f55469970ce01fbe7
View file https://github.com/angular/angular-cli/blob/34a4902d2839ea1f35aa28363756319c8190abe2/packages/angular/build/src/builders/unit-test/tests/options/conditions_spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/33246/{{ revealButtonHref }}
Please reload this pagehttps://github.com/angular/angular-cli/pull/33246/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.