Skip to content

Commit 8f63b00

Browse files
committedSep 8, 2021
fix(tsbb): Fix empty out dir issue.
1 parent da1c454 commit 8f63b00

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎packages/tsbb/src/utils/compile.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ export async function compile(
1919
cjs = path.relative(ts.sys.getCurrentDirectory(), cjs);
2020
return new Promise(async (resolve, reject) => {
2121
try {
22-
await FS.remove(outDir);
22+
if (tsOptions.outDir || cjs) {
23+
await FS.remove(outDir);
24+
}
25+
if (esm) {
26+
await FS.remove(path.resolve(process.cwd(), esm));
27+
}
2328
const dirToFiles = await recursiveReaddirFiles(path.dirname(entry), {
2429
exclude: /(tsconfig.json|.d.ts|.(test|spec).(ts|tsx|js|jsx))$/,
2530
});

0 commit comments

Comments
 (0)
Please sign in to comment.