feat(@angular/build): add library builder #34106

Open
alan-agius4 opened 11:21am on September 17, 2026 wants to merge 1 Ξ” into angular/angular-cli main from
feat/library-builder

Pull Request Overview

  • Opened on September 17, 2026
  • Status Open
  • Commit count 1 with first commit September 17, 2026

Total Delta

1 Total Diff Delta

Open Days

Open 2 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
0.0 days Authoring 0 commits before pull request opened for review
 
0.0 days Awaiting first review
 
1.5 days Revising work with 1 commit in response to 3 reviews that left 12 comments

Total time for pull request still awaiting merge: 1.5 business days

Author avatar

feat(@angular/build): add library builder

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type


  • [x] Feature

What is the current behavior?

Currently, there is no native @angular/build:library builder in @angular/build.

Issue Number: N/A

What is the new behavior?

Add a new native @angular/build:library builder providing a modern, high-performance compilation and packaging pipeline.

Does this PR introduce a breaking change?


  • [x] No

Other information

Comments Threads Pending Resolution

gemini-code-assist[bot] reviewed on September 17, 2026
gemini-code-assist[bot] left a comment

## Code Review

This pull request introduces a new library builder for Angular, enabling the compilation, bundling, and packaging of libraries in accordance with the Angular Package Format (APF). The changes include the core builder logic, a dependency graph scanner for entry points, an incremental compilation pipeline, and support for secondary entry points. My review highlights performance optimizations for the dependency predicate and file change detection logic, which are critical for maintaining build speed in larger projects.

modules/testing/builder/src/builder-harness.ts
112
  }
113
114 114
 
 private
 resolvePath(path: string): string {
115
    return join(getSystemPath(this.host.root()), path);
116
  }
gemini-code-assist[bot] reviewed on September 17, 2026
gemini-code-assist[bot] left a comment

## Code Review

This pull request introduces a new library builder (`@angular/build:library`) designed to compile, bundle, and package Angular libraries in compliance with the Angular Package Format (APF). It includes features such as incremental compilation, watch mode, asset copying, secondary entry point resolution, and package.json generation. The review feedback highlights a few critical areas for improvement: ensuring the package name is updated in options when `package.json` changes in watch mode, optimizing startup by avoiding redundant reads of `package.json`, and capturing and propagating stylesheet compilation warnings to the user.

modules/testing/builder/src/builder-harness.ts
112
  }
113
114 114
 
 private
 resolvePath(path: string): string {
115
    return join(getSystemPath(this.host.root()), path);
116
  }
gemini-code-assist[bot] reviewed on September 17, 2026
gemini-code-assist[bot] left a comment

## Code Review

This pull request introduces a new `@angular/build:library` builder designed to compile, bundle, and package Angular libraries in compliance with the Angular Package Format (APF). It features topological sorting of entry points, Rolldown-based ESM and DTS bundling, and a worker pool for concurrent compilation. Feedback on the changes highlights a few critical issues: runtime `ReferenceError`s due to the use of `require` and `require.resolve` in an ESM environment, which should be resolved using `createRequire`; potential overwriting of custom user `.npmignore` files during package.json generation; and a typo in the `AngularCompilationOptions` interface where `declerationMap` should be corrected to `declarationMap`.

modules/testing/builder/src/builder-harness.ts
112
  }
113
114 114
 
 private
 resolvePath(path: string): string {
115
    return join(getSystemPath(this.host.root()), path);
116
  }

Resolved Comment Threads

No resolved comments have been left on this PR.