From 4c038d665e611992b74eab338a3cd6cebc0cbdad Mon Sep 17 00:00:00 2001 From: Floffah Date: Mon, 21 Oct 2024 19:32:46 +0100 Subject: [PATCH] chore: clean up bundle fn with finally block instead of catch and throw --- src/lib/generateBundle.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lib/generateBundle.ts b/src/lib/generateBundle.ts index b9cc8db..6e75372 100644 --- a/src/lib/generateBundle.ts +++ b/src/lib/generateBundle.ts @@ -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; } }