From b4e3206cc1569d0f9ee1eae98a1b3786aa8fff41 Mon Sep 17 00:00:00 2001 From: RiESAEX <2597245950@qq.com> Date: Wed, 28 Dec 2022 02:17:58 +0000 Subject: [PATCH] feat: log more error --- .../src/plugins/commands/build/build.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/fes-builder-webpack/src/plugins/commands/build/build.js b/packages/fes-builder-webpack/src/plugins/commands/build/build.js index 2a2673db..fa50b1c6 100644 --- a/packages/fes-builder-webpack/src/plugins/commands/build/build.js +++ b/packages/fes-builder-webpack/src/plugins/commands/build/build.js @@ -4,10 +4,16 @@ export async function build({ bundleConfig }) { return new Promise((resolve, reject) => { const compiler = webpack(bundleConfig); compiler.run((err, stats) => { - if (err || stats.hasErrors()) { + if (err) { console.error(err); return reject(new Error('build failed')); } + if (stats?.hasErrors()) { + stats.compilation.errors.forEach((e) => { + console.error(e); + }); + return reject(new Error('build failed')); + } resolve({ stats }); }); });