Skip to content

Commit

Permalink
fix(tsbb): Fix empty out dir issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 8, 2021
1 parent da1c454 commit 8f63b00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/tsbb/src/utils/compile.ts
Expand Up @@ -19,7 +19,12 @@ export async function compile(
cjs = path.relative(ts.sys.getCurrentDirectory(), cjs);
return new Promise(async (resolve, reject) => {
try {
await FS.remove(outDir);
if (tsOptions.outDir || cjs) {
await FS.remove(outDir);
}
if (esm) {
await FS.remove(path.resolve(process.cwd(), esm));
}
const dirToFiles = await recursiveReaddirFiles(path.dirname(entry), {
exclude: /(tsconfig.json|.d.ts|.(test|spec).(ts|tsx|js|jsx))$/,
});
Expand Down

0 comments on commit 8f63b00

Please sign in to comment.