From 286994fb7742961878ea1e17acd994d9fada79d7 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sun, 3 Oct 2021 22:20:22 +0800 Subject: [PATCH] fix(tsbb): fix match copy files. --- packages/tsbb/src/utils/watchCompile.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/tsbb/src/utils/watchCompile.ts b/packages/tsbb/src/utils/watchCompile.ts index 38276485..0c1a9559 100644 --- a/packages/tsbb/src/utils/watchCompile.ts +++ b/packages/tsbb/src/utils/watchCompile.ts @@ -39,7 +39,14 @@ export async function watchCompile( !isMatch(path.resolve(output), ['**/?(*.)+(spec|test).[jt]s?(x)', '**/*.d.ts', '**/tsconfig.json']) ) { transform(filepath, { entryDir, esm, ...other }); - } else if (!isMatch(path.resolve(output), ['**/?(*.)+(spec|test).[jt]s?(x)', '**/tsconfig.json', '**/*.d.ts'])) { + } else if ( + !isMatch(path.resolve(output), [ + '**/?(*.)+(spec|test).[jt]s?(x)', + '**/*.[jt]s?(x)', + '**/tsconfig.json', + '**/*.d.ts', + ]) + ) { const result = ts.sys.readFile(filepath); outputFiles(output, result); } @@ -52,7 +59,14 @@ export async function watchCompile( !isMatch(path.resolve(output), ['**/?(*.)+(spec|test).[jt]s?(x)', '**/*.d.ts']) ) { transform(filepath, { entryDir, cjs, ...other }); - } else if (!isMatch(path.resolve(output), ['**/?(*.)+(spec|test).[jt]s?(x)', '**/tsconfig.json', '**/*.d.ts'])) { + } else if ( + !isMatch(path.resolve(output), [ + '**/?(*.)+(spec|test).[jt]s?(x)', + '**/*.[jt]s?(x)', + '**/tsconfig.json', + '**/*.d.ts', + ]) + ) { const result = ts.sys.readFile(filepath); outputFiles(output, result); }