From 0b7d43a4bb6309fab29e99204cb2dde9c4cc603b Mon Sep 17 00:00:00 2001 From: Ming <527990618@163.com> Date: Wed, 18 Sep 2024 14:43:24 +0800 Subject: [PATCH] fix: should filter tsconfig.json --- .../server/utils/src/compilers/typescript/index.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/server/utils/src/compilers/typescript/index.ts b/packages/server/utils/src/compilers/typescript/index.ts index f951d248dfe7..5c0686ced0e9 100644 --- a/packages/server/utils/src/compilers/typescript/index.ts +++ b/packages/server/utils/src/compilers/typescript/index.ts @@ -16,18 +16,14 @@ const readTsConfigByFile = (tsConfigFile: string, tsInstance: typeof ts) => { return { options, fileNames, projectReferences }; }; -const copyFiles = async ( - from: string, - to: string, - appDirectory: string, - tsconfigPath: string, -) => { +const copyFiles = async (from: string, to: string, appDirectory: string) => { if (await fs.pathExists(from)) { const relativePath = path.relative(appDirectory, from); const targetDir = path.join(to, relativePath); await fs.copy(from, targetDir, { filter: src => - !['.ts', '.js'].includes(path.extname(src)) && src !== tsconfigPath, + !['.ts', '.js'].includes(path.extname(src)) && + src.endsWith('tsconfig.json'), }); } };