◐ Shell
clean mode source ↗

fix(@angular/build): forward tsconfig paths as Vite aliases for Vitest coverage by tomeelog · Pull Request #33024 · angular/angular-cli

…t coverage

When using tsconfig.json 'paths' (e.g. "#/util": ["./src/util"]) with
coverage enabled, Vitest's vite:import-analysis plugin fails to resolve
path-alias imports from original source files during coverage processing
because the Angular CLI's Vitest integration did not expose those aliases
to the Vite resolve configuration.

The fix reads the tsconfig file, converts every paths entry to a Vite
resolve.alias entry (supporting both exact and wildcard patterns), and
injects them into the projectDefaults resolve config used by the project
workspace. This makes path aliases available during both test execution
and coverage instrumentation.

Fixes angular#32891