Skip to content

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

Open
alan-agius4 wants to merge 1 commit into
angular:mainfrom
alan-agius4:refactor/rolldown-options
Open

refactor(@angular/build): migrate to optimizeDeps.rolldownOptions in Vite config#33434
alan-agius4 wants to merge 1 commit 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
…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 22ab38d to 0c5a271 Compare June 23, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer 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.

1 participant