Repository navigation
fix(@angular/build): enforce library compilerOptions and skip app-only target warning - #34437
Conversation
….tsbuildinfo emit Ensure library compilations explicitly set `noEmit: false`, `emitDeclarationOnly: false`, and `emitDecoratorMetadata: false` in `transformCompilerOptions` so that configurations extending a root `tsconfig.json` with `noEmit` or `emitDeclarationOnly` still emit both JavaScript and declaration files. Additionally, skip the application-specific `target < ES2022` Browserslist warning and `useDefineForClassFields = false` fallback when compiling libraries, and avoid serializing and writing on-disk `.tsbuildinfo` files during library builds since library outputs are emitted into in-memory maps on cold builds and watch rebuilds reuse the in-memory `BuilderProgram` directly.
…unused .tsbuildinfo emit
…unused .tsbuildinfo emit
There was a problem hiding this comment.
Code Review
This pull request updates the compiler options transformation logic for Angular libraries. Specifically, it ensures that when building a library, options such as noEmit, emitDeclarationOnly, and emitDecoratorMetadata are explicitly overridden to false to ensure proper generation of both JavaScript and declaration files. Additionally, it skips the application-only target warning for libraries. Unit and behavior tests have been added to verify these behaviors. I have no feedback to provide as there are no review comments.
…unused .tsbuildinfo emit
…unused .tsbuildinfo emit
…unused .tsbuildinfo emit
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Ensure library compilations explicitly set
noEmit: falseandemitDeclarationOnly: falseintransformCompilerOptionsso that configurations extending a roottsconfig.jsonwithnoEmitoremitDeclarationOnlystill emit both JavaScript and declaration files.Additionally, apply library
compilerOptionsoverrides before thetarget < ES2022check so the application-specific Browserslist warning anduseDefineForClassFields = falsefallback are skipped when compiling libraries.