From a317bf1c17940bb9fa90a2b0ee6f1c01da5a559f Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Wed, 20 Dec 2023 21:04:29 +0800 Subject: [PATCH] chore: explicitly set tsBuildInfoFile in tsconfig.*.json files To avoid polluting the root directory with tsconfig.*.tsbuildinfo files. `outDir` in the base config doesn't work because of https://github.com/vuejs/tsconfig/issues/27#issuecomment-1859708129 Besides, we need this explicit config in `tsconfig.node.json` anyways, as it doesn't extend from `@vue/tsconfig`. Using `.tmp` instead of `.cache` here to better indicate the purpose. --- template/tsconfig/base/tsconfig.app.json | 3 ++- template/tsconfig/base/tsconfig.node.json | 2 ++ template/tsconfig/cypress-ct/tsconfig.cypress-ct.json | 3 ++- template/tsconfig/nightwatch-ct/tsconfig.app.json | 3 ++- template/tsconfig/nightwatch/nightwatch/tsconfig.json | 6 ++++-- template/tsconfig/vitest/tsconfig.vitest.json | 2 ++ 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/template/tsconfig/base/tsconfig.app.json b/template/tsconfig/base/tsconfig.app.json index 491e0939..e14c754d 100644 --- a/template/tsconfig/base/tsconfig.app.json +++ b/template/tsconfig/base/tsconfig.app.json @@ -4,7 +4,8 @@ "exclude": ["src/**/__tests__/*"], "compilerOptions": { "composite": true, - "noEmit": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "baseUrl": ".", "paths": { "@/*": ["./src/*"] diff --git a/template/tsconfig/base/tsconfig.node.json b/template/tsconfig/base/tsconfig.node.json index 46cf2e14..47712ab3 100644 --- a/template/tsconfig/base/tsconfig.node.json +++ b/template/tsconfig/base/tsconfig.node.json @@ -10,6 +10,8 @@ "compilerOptions": { "composite": true, "noEmit": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "module": "ESNext", "moduleResolution": "Bundler", "types": ["node"] diff --git a/template/tsconfig/cypress-ct/tsconfig.cypress-ct.json b/template/tsconfig/cypress-ct/tsconfig.cypress-ct.json index b21f0843..12833b27 100644 --- a/template/tsconfig/cypress-ct/tsconfig.cypress-ct.json +++ b/template/tsconfig/cypress-ct/tsconfig.cypress-ct.json @@ -9,6 +9,7 @@ ], "exclude": [], "compilerOptions": { - "composite": true + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.cypress-ct.tsbuildinfo" } } diff --git a/template/tsconfig/nightwatch-ct/tsconfig.app.json b/template/tsconfig/nightwatch-ct/tsconfig.app.json index 491e0939..e14c754d 100644 --- a/template/tsconfig/nightwatch-ct/tsconfig.app.json +++ b/template/tsconfig/nightwatch-ct/tsconfig.app.json @@ -4,7 +4,8 @@ "exclude": ["src/**/__tests__/*"], "compilerOptions": { "composite": true, - "noEmit": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "baseUrl": ".", "paths": { "@/*": ["./src/*"] diff --git a/template/tsconfig/nightwatch/nightwatch/tsconfig.json b/template/tsconfig/nightwatch/nightwatch/tsconfig.json index ca4be1af..8e4378cc 100644 --- a/template/tsconfig/nightwatch/nightwatch/tsconfig.json +++ b/template/tsconfig/nightwatch/nightwatch/tsconfig.json @@ -1,11 +1,13 @@ { "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { + "composite": true, + "noEmit": true, + "tsBuildInfoFile": "../node_modules/.tmp/nightwatch.tsbuildinfo", + "target": "ESNext", "module": "commonjs", "moduleResolution": "node", - "composite": true, - "noEmit": true, "rootDir": "../", "lib": ["ESNext", "dom"], "types": ["nightwatch"] diff --git a/template/tsconfig/vitest/tsconfig.vitest.json b/template/tsconfig/vitest/tsconfig.vitest.json index d080d611..571995d1 100644 --- a/template/tsconfig/vitest/tsconfig.vitest.json +++ b/template/tsconfig/vitest/tsconfig.vitest.json @@ -3,6 +3,8 @@ "exclude": [], "compilerOptions": { "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo", + "lib": [], "types": ["node", "jsdom"] }