Skip to content

Commit 3d00e66

Browse files
⚡ [performance improvement] Replace synchronous remove with async remove in bundle.ts
- Replaced `fs.removeSync` with `await fs.remove` in `compileHermesByteCode` and `copyDebugidForSentry` functions within `src/bundle.ts`. - This change avoids blocking the event loop during I/O operations, making the codebase more efficient. - Verified that the changes were correctly applied and the project remains stable. Co-authored-by: sunnylqm <615282+sunnylqm@users.noreply.github.com>
1 parent 3a754fb commit 3d00e66

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/bundle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ async function compileHermesByteCode(
368368
);
369369
}
370370
if (shouldCleanSourcemap) {
371-
fs.removeSync(path.join(outputFolder, `${bundleName}.txt.map`));
371+
await fs.remove(path.join(outputFolder, `${bundleName}.txt.map`));
372372
}
373373
}
374374

@@ -407,7 +407,7 @@ async function copyDebugidForSentry(
407407
},
408408
);
409409
}
410-
fs.removeSync(path.join(outputFolder, `${bundleName}.txt.map`));
410+
await fs.remove(path.join(outputFolder, `${bundleName}.txt.map`));
411411
}
412412

413413
async function uploadSourcemapForSentry(

0 commit comments

Comments
 (0)