Skip to content

refactor(@angular/build): support library compilation in AngularCompilation - #34174

Merged
alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:refactor/angular-compilation-library-support
Sep 28, 2026
Merged

alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:refactor/angular-compilation-library-support

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Adds library compilation support (buildType: 'application' | 'library') to AngularCompilation, TypeScriptCompilation, AotCompilation, and transformCompilerOptions:

  • Support declarationMap, compilationMode, and paths overrides in CompilerOptionOverrides.
  • Configure library-specific compiler options (declaration, importHelpers, Bundler module resolution, external sourceMap, and TypeScript transpilation) when buildType === 'library'.
  • Emit multiple files per SourceFile (.js, .d.ts, .d.ts.map) in AotCompilation.emitAffectedFiles() and skip application-only transformers (replaceBootstrap, webWorkerTransform, lazyRoutesTransformer) during library emission.

@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 introduces support for compiling Angular libraries by adding a buildType parameter ('application' or 'library') across the compilation pipeline and adjusting compiler options and emit behavior accordingly. The feedback highlights an issue in parallel-worker.ts where the returned compilerOptions object is missing the newly added declarationMap property, which would prevent the main thread from receiving the correct configuration during parallel compilation.

@alan-agius4 alan-agius4 added the target: minor This PR is targeted for the next minor release label Sep 25, 2026
@alan-agius4
alan-agius4 requested a review from clydin September 25, 2026 08:25
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 25, 2026
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 28, 2026
@alan-agius4
alan-agius4 merged commit 295550b into angular:main Sep 28, 2026
41 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4
alan-agius4 deleted the refactor/angular-compilation-library-support branch September 28, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker 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.

2 participants