Skip to content

refactor(@angular/build): migrate to optimizeDeps.rolldownOptions in Vite config#33434

Merged
alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:refactor/rolldown-options
Jun 23, 2026
Merged

refactor(@angular/build): migrate to optimizeDeps.rolldownOptions in Vite config#33434
alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:refactor/rolldown-options

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Vite now uses Rolldown as the underlying engine to optimize dependencies, rendering optimizeDeps.esbuildOptions deprecated.

This commit refactors the Vite dev-server config in @angular/build to use optimizeDeps.rolldownOptions instead.
It also updates the custom dependency optimization plugin from the esbuild-specific format to a native Rolldown plugin using the load hook, and aligns browser target lowering by pushing es2016 when Zone.js is present (since Rolldown lacks esbuild-style feature-support flags).

@alan-agius4 alan-agius4 requested a review from clydin June 23, 2026 09:53
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release and removed area: @angular/build labels Jun 23, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request transitions the Vite dev-server dependency optimization configuration from Esbuild to Rolldown, removing the zoneless parameter and introducing rolldownOptions. Feedback highlights a critical issue in the new load hook where virtual modules and query parameters/hashes in module IDs are not handled, which could lead to build failures or skipped compilation. A code suggestion is provided to clean the module IDs before matching and transforming.

Comment thread packages/angular/build/src/tools/vite/utils.ts Outdated
@alan-agius4 alan-agius4 force-pushed the refactor/rolldown-options branch from 2657293 to 22ab38d Compare June 23, 2026 10:05
@alan-agius4 alan-agius4 force-pushed the refactor/rolldown-options branch 8 times, most recently from 84d12aa to 5739075 Compare June 23, 2026 13:25
…Vite config

Vite now uses Rolldown as the underlying engine to optimize dependencies, rendering `optimizeDeps.esbuildOptions` deprecated.

This commit refactors the Vite dev-server config in `@angular/build` to use `optimizeDeps.rolldownOptions` instead.
It also updates the custom dependency optimization plugin from the esbuild-specific format to a native Rolldown plugin using the `load` hook, and aligns browser target lowering by pushing `es2016` when Zone.js is present (since Rolldown lacks esbuild-style feature-support flags).
@alan-agius4 alan-agius4 force-pushed the refactor/rolldown-options branch from 5739075 to fcc7b60 Compare June 23, 2026 13:29
Comment thread packages/angular/build/src/builders/dev-server/vite/index.ts Outdated
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 23, 2026
@alan-agius4 alan-agius4 merged commit a583431 into angular:main Jun 23, 2026
16 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4 alan-agius4 deleted the refactor/rolldown-options branch June 23, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants