Skip to content

Commit 7c51797

Browse files
committedSep 26, 2021
fix(tsbb): Fix the issue of emptying the folder.
1 parent 0a981ee commit 7c51797

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export async function compile(
1414
options: CompileOptions,
1515
): Promise<void> {
1616
let { entry, disableBabel, cjs = tsOptions.outDir || 'lib', esm = 'esm', ...other } = options || {};
17-
const outDir = path.resolve(process.cwd(), tsOptions.outDir || cjs);
17+
const outDir = path.resolve(process.cwd(), cjs || tsOptions.outDir);
1818
const entryDir = path.dirname(entry);
1919
cjs = path.relative(ts.sys.getCurrentDirectory(), cjs);
2020
return new Promise(async (resolve, reject) => {
2121
try {
22-
if (tsOptions.outDir || cjs) {
22+
if (cjs || tsOptions.outDir) {
2323
await FS.remove(outDir);
2424
}
2525
if (typeof esm === 'string') {

0 commit comments

Comments
 (0)
Please sign in to comment.