From 4e8ca5ecf8aaac87cc3825aa3cb137d900d3b613 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sun, 7 Jul 2024 17:11:46 -0700 Subject: [PATCH] tsconfig: composite implies incremental fix: https://github.com/isaacs/tshy/issues/82 --- src/clean-build-tmp.ts | 5 ++++- test/clean-build-tmp.ts | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/clean-build-tmp.ts b/src/clean-build-tmp.ts index 76e690f..fbaef62 100644 --- a/src/clean-build-tmp.ts +++ b/src/clean-build-tmp.ts @@ -63,7 +63,10 @@ const cleanRemovedOutputs = (path: string, root: string) => { export default () => { const config = readTypescriptConfig() - if (config.options.incremental !== true) { + if ( + config.options.incremental !== true && + config.options.composite !== true + ) { return rimrafSync('.tshy-build') } diff --git a/test/clean-build-tmp.ts b/test/clean-build-tmp.ts index de5c462..74ee501 100644 --- a/test/clean-build-tmp.ts +++ b/test/clean-build-tmp.ts @@ -5,6 +5,7 @@ import readTypescriptConfig from '../src/read-typescript-config.js' t.test('no incremental build, just delete it', t => { readTypescriptConfig().options.incremental = false + readTypescriptConfig().options.composite = false t.chdir( t.testdir({ '.tshy-build': {}, @@ -17,6 +18,7 @@ t.test('no incremental build, just delete it', t => { t.test('no tsbuildinfo, just delete it', t => { readTypescriptConfig().options.incremental = true + readTypescriptConfig().options.composite = true t.chdir( t.testdir({ '.tshy-build': {}, @@ -28,7 +30,7 @@ t.test('no tsbuildinfo, just delete it', t => { }) t.test('remove files not found in src', t => { - readTypescriptConfig().options.incremental = true + readTypescriptConfig().options.composite = true t.chdir( t.testdir({ '.tshy-build': {