mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-12-02 03:37:57 +08:00
feat: log more error
This commit is contained in:
parent
0e05f23bc1
commit
f5dddd7700
@ -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 });
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user