diff --git a/bin/index.mts b/bin/index.mts index 05570f840..1fde60ba3 100755 --- a/bin/index.mts +++ b/bin/index.mts @@ -272,7 +272,7 @@ async function handleContexts( if (watch) { await context.watch(); } else { - await context.rebuild().catch(() => {}); + await context.rebuild().catch(() => process.exit(1)); context.dispose(); } }), @@ -364,7 +364,9 @@ async function buildPlugin({ watch, noInstall, production, noReload, addon }: Ar const install: esbuild.Plugin = { name: "install", setup: (build) => { - build.onEnd(async () => { + build.onEnd(async (result) => { + if (result.errors.length > 0) return; + if (!noInstall) { const dest = path.join(CONFIG_PATH, "plugins", manifest.id); if (existsSync(dest)) rmSync(dest, { recursive: true, force: true }); @@ -452,7 +454,9 @@ async function buildTheme({ watch, noInstall, production, noReload, addon }: Arg const install: esbuild.Plugin = { name: "install", setup: (build) => { - build.onEnd(async () => { + build.onEnd(async (result) => { + if (result.errors.length > 0) return; + if (!noInstall) { const dest = path.join(CONFIG_PATH, "themes", manifest.id); if (existsSync(dest)) rmSync(dest, { recursive: true, force: true }); diff --git a/scripts/build.mts b/scripts/build.mts index 8e314b2fe..ff10da1c2 100644 --- a/scripts/build.mts +++ b/scripts/build.mts @@ -33,7 +33,9 @@ rmSync("replugged.asar", { force: true }); const preBundle: esbuild.Plugin = { name: "preBundle", setup: (build) => { - build.onEnd(() => { + build.onEnd((result) => { + if (result.errors.length > 0) return; + if (!existsSync(`${distDir}/i18n`)) { mkdirSync(`${distDir}/i18n`); } @@ -114,7 +116,7 @@ await Promise.all( if (watch) { await context.watch(); } else { - await context.rebuild().catch(() => {}); + await context.rebuild().catch(() => process.exit(1)); context.dispose(); } }),