Skip to content

Commit 4f9c4cb

Browse files
committed
fixup! fix(@angular/build): enforce library compilerOptions and skip unused .tsbuildinfo emit
1 parent 373dcc1 commit 4f9c4cb

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎packages/angular/build/src/tools/angular/compilation/angular-compilation_spec.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,9 @@ describe('AngularCompilation', () => {
477477
expect(compilerOptions['_useTypeScriptTranspilation']).toBe(true);
478478
expect(compilerOptions.supportTestBed).toBe(true);
479479
expect(compilerOptions.supportJitMode).toBe(true);
480+
expect(compilerOptions.noEmit).toBe(false);
480481
expect(compilerOptions.noEmitOnError).toBe(false);
482+
expect(compilerOptions.emitDeclarationOnly).toBe(false);
481483
expect(compilerOptions.composite).toBe(false);
482484
});
483485

@@ -498,6 +500,7 @@ describe('AngularCompilation', () => {
498500
);
499501

500502
expect(compilerOptions.target).toBe(ts.ScriptTarget.ES2022);
503+
expect(compilerOptions.module).toBe(ts.ModuleKind.Preserve);
501504
expect(compilerOptions.useDefineForClassFields).toBeUndefined();
502505
expect(compilerOptions.noEmit).toBe(false);
503506
expect(compilerOptions.emitDeclarationOnly).toBe(false);

‎packages/angular/build/src/tools/angular/compilation/compiler-options.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,13 @@ export function transformCompilerOptions(
4141

4242
if (isLibrary) {
4343
compilerOptions.target = typeScript.ScriptTarget.ES2022;
44-
compilerOptions.module = typeScript.ModuleKind.ES2022;
44+
compilerOptions.module = typeScript.ModuleKind.Preserve;
4545
compilerOptions.importHelpers = true;
4646
compilerOptions.declaration = true;
4747
compilerOptions.declarationMap = !!(
4848
overrides?.declarationMap ?? compilerOptions.declarationMap
4949
);
5050
compilerOptions.declarationDir = undefined;
51-
compilerOptions.noEmit = false;
52-
compilerOptions.emitDeclarationOnly = false;
5351
}
5452

5553
if (
@@ -138,7 +136,9 @@ export function transformCompilerOptions(
138136
compilerOptions: {
139137
...compilerOptions,
140138
basePath: overrides?.basePath ? toPosixPath(overrides.basePath) : compilerOptions.basePath,
139+
noEmit: false,
141140
noEmitOnError: false,
141+
emitDeclarationOnly: false,
142142
composite: false,
143143
inlineSources: !!overrides?.sourcemap,
144144
inlineSourceMap: !isLibrary && !!overrides?.sourcemap,

0 commit comments

Comments
 (0)