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 }); }); });