feat(@angular/build): move istanbul-lib-instrument to optional peer dependency by clydin · Pull Request #32935 · angular/angular-cli

@clydin added the target: major

This PR is targeted for the next major release

label

Apr 3, 2026

@clydin

…library generator dependencies

Update addTestRunnerDependencies to include istanbul-lib-instrument when generating new applications or libraries with the Karma test runner.

@clydin clydin marked this pull request as ready for review

April 3, 2026 18:03

gemini-code-assist[bot]

…ependency

Move `istanbul-lib-instrument` from dependencies to optional peer dependencies. This helps reduce the transitive dependency count for new projects.

BREAKING CHANGE: `istanbul-lib-instrument` is now an optional peer dependency.
Projects using karma with code coverage enabled will need to ensure that istanbul-lib-instrument is installed. Note: `ng update` will automatically add this dependency during the update process.
Add a new schematic migration to automatically add istanbul-lib-instrument to devDependencies for projects that use Karma.

Covered builders:
- @angular-devkit/build-angular:karma
- @angular/build:karma
- @angular/build:unit-test (when runner is 'karma')

@clydin clydin added the action: review

The PR is still awaiting reviews from at least one requested reviewer

label

Apr 3, 2026