From 8bbfce4924c2327e24f1959e51812cdc4892ce9b Mon Sep 17 00:00:00 2001 From: mingxuanzhang Date: Thu, 3 Oct 2024 15:43:21 -0700 Subject: [PATCH] chore: report error whenever there is one --- scripts/bundleWithCheck.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/bundleWithCheck.js b/scripts/bundleWithCheck.js index cdecf5006..b77010314 100644 --- a/scripts/bundleWithCheck.js +++ b/scripts/bundleWithCheck.js @@ -6,6 +6,10 @@ const commandToRun = 'yarn build && node ./scripts/build.js'; exec(commandToRun, (error, stdout, stderr) => { // Combine stdout and stderr to check the entire output const output = `${stdout}\n${stderr}`; + if (error) { + console.error(output); + process.exit(1); // Exit with an error code + } // Check if the output contains the error string of esbuild if (output.includes('[require-resolve-not-external]')) { console.error('Error: A dependency that has to be externalized in esbuild process is found. Please resolve it!');