You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4d3926d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(@angular/build): rebase Vitest incremental paths when workspace root is aliased
When `vitestConfig.root` differs from `workspaceRoot` (such as with symlinks or Windows `subst` drives), `VitestExecutor` still invalidated and queried test specifications during incremental watch-mode rebuilds using the un-rebased `workspaceRoot` paths. Because Vitest keys its module graph and test specifications against `vitest.config.root`, incremental re-runs could fail to invalidate cached modules or locate the affected test specifications.
To address this, extract a `rebasePath` helper in `plugins.ts` that converts paths between roots while leaving paths that cannot be expressed relative to the original root (such as files on a different Windows drive) unchanged instead of concatenating them. `VitestExecutor` now uses this helper during incremental rebuilds to rebase modified output and source file paths onto `vitest.config.root` when the root is aliased. Additionally, `configureVitest` now rebases from the original plugin options rather than mutating from the previous root so repeated invocations remain idempotent. `plugins_spec.ts` is expanded to cover `rebasePath`, `angular:` virtual entries, absolute setup files under coverage, and repeated `configureVitest` calls, and a new `executor_spec.ts` covers the incremental rebuild paths.
0 commit comments