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!');