Skip to content

Commit

Permalink
chore: clean up bundle fn with finally block instead of catch and throw
Browse files Browse the repository at this point in the history
  • Loading branch information
Floffah committed Oct 21, 2024
1 parent 85757e6 commit 4c038d6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/lib/generateBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,9 @@ export function generateBundle(
if (compilerOptions.declarationDir!.endsWith("dts-prebundle")) {
rmSync(compilerOptions.declarationDir!, { recursive: true });
}

} finally {
if (shouldDeleteTsConfig && tsconfigPath) {
rmSync(tsconfigPath);
}
} catch (e) {
if (shouldDeleteTsConfig && tsconfigPath) {
rmSync(tsconfigPath);
}

throw e;
}
}

0 comments on commit 4c038d6

Please sign in to comment.