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); }