Commit 182ecbd 1 parent da2a6bd commit 182ecbd Copy full SHA for 182ecbd
File tree 2 files changed +40
-5
lines changed
packages/angular/build/src
builders/application/tests/behavior
2 files changed +40
-5
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+
9
+ import { buildApplication } from '../../index' ;
10
+ import { APPLICATION_BUILDER_INFO , BASE_OPTIONS , describeBuilder } from '../setup' ;
11
+
12
+ describeBuilder ( buildApplication , APPLICATION_BUILDER_INFO , ( harness ) => {
13
+ describe ( 'Behavior: "TypeScript explicit incremental option usage"' , ( ) => {
14
+ it ( 'should successfully build with incremental disabled' , async ( ) => {
15
+ // Disable tsconfig incremental option in tsconfig
16
+ await harness . modifyFile ( 'tsconfig.json' , ( content ) => {
17
+ const tsconfig = JSON . parse ( content ) ;
18
+ tsconfig . compilerOptions . incremental = false ;
19
+
20
+ return JSON . stringify ( tsconfig ) ;
21
+ } ) ;
22
+
23
+ harness . useTarget ( 'build' , {
24
+ ...BASE_OPTIONS ,
25
+ } ) ;
26
+
27
+ const { result } = await harness . executeOnce ( ) ;
28
+
29
+ expect ( result ?. success ) . toBe ( true ) ;
30
+ } ) ;
31
+ } ) ;
32
+ } ) ;
Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ export function createCompilerPlugin(
284
284
location : null ,
285
285
notes : [
286
286
{
287
- text : error instanceof Error ? error . stack ?? error . message : `${ error } ` ,
287
+ text : error instanceof Error ? ( error . stack ?? error . message ) : `${ error } ` ,
288
288
location : null ,
289
289
} ,
290
290
] ,
@@ -315,7 +315,7 @@ export function createCompilerPlugin(
315
315
location : null ,
316
316
notes : [
317
317
{
318
- text : error instanceof Error ? error . stack ?? error . message : `${ error } ` ,
318
+ text : error instanceof Error ? ( error . stack ?? error . message ) : `${ error } ` ,
319
319
location : null ,
320
320
} ,
321
321
] ,
@@ -537,9 +537,12 @@ function createCompilerOptionsTransformer(
537
537
compilerOptions . compilationMode = 'full' ;
538
538
}
539
539
540
- // Enable incremental compilation by default if caching is enabled
541
- if ( pluginOptions . sourceFileCache ?. persistentCachePath ) {
542
- compilerOptions . incremental ??= true ;
540
+ // Enable incremental compilation by default if caching is enabled and incremental is not explicitly disabled
541
+ if (
542
+ compilerOptions . incremental !== false &&
543
+ pluginOptions . sourceFileCache ?. persistentCachePath
544
+ ) {
545
+ compilerOptions . incremental = true ;
543
546
// Set the build info file location to the configured cache directory
544
547
compilerOptions . tsBuildInfoFile = path . join (
545
548
pluginOptions . sourceFileCache ?. persistentCachePath ,
You can’t perform that action at this time.
0 commit comments