Skip to content

fix(@angular/build): support TypeScript isolatedDeclarations option#32349

Closed
cexbrayat wants to merge 1 commit intoangular:mainfrom
cexbrayat:fix/isolated-declarations
Closed

fix(@angular/build): support TypeScript isolatedDeclarations option#32349
cexbrayat wants to merge 1 commit intoangular:mainfrom
cexbrayat:fix/isolated-declarations

Conversation

@cexbrayat
Copy link
Member

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Recently, the Angular team said on a panel that isolatedDeclarations can make a huge difference in build times, but we currently can't test it in the CLI.

Angular CLI forcefully set both declaration and composite to false, which prevents the use of isolatedDeclarations as TypeScript requires at least one of these options to be true when isolatedDeclarations is set (TS5069 error):

✘ [ERROR] TS5069: Option 'isolatedDeclarations' cannot be specified without specifying option 'declaration' or option 'composite'. [plugin angular-compiler]

What is the new behavior?

This change allows the use of TypeScript's isolatedDeclarations compiler option by conditionally preserving the declaration and composite options when isolatedDeclarations is enabled.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This change allows the use of TypeScript's isolatedDeclarations compiler
option by conditionally preserving the declaration and composite options
when isolatedDeclarations is enabled.

Previously, the Angular CLI forcefully set both declaration and composite
to false, which prevented the use of isolatedDeclarations as TypeScript
requires at least one of these options to be true when isolatedDeclarations
is set (TS5069 error):

```
✘ [ERROR] TS5069: Option 'isolatedDeclarations' cannot be specified without specifying option 'declaration' or option 'composite'. [plugin angular-compiler]
```
@cexbrayat cexbrayat force-pushed the fix/isolated-declarations branch from 143e651 to 1d95ebf Compare January 22, 2026 16:37
@cexbrayat
Copy link
Member Author

cexbrayat commented Jan 22, 2026

@clydin @alan-agius4 In your opinion, can isolatedDeclarations speed up builds with the CLI?

...compilerOptions,
noEmitOnError: false,
composite: false,
// TypeScript requires either declaration or composite to be true when isolatedDeclarations is set
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will most likely slow down the build since we'd be generating declarations we don't really need for an app. Also, our current setup does handles composite projects yet.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants