mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
Merge pull request #12957 from strapi/fix/build-error-swallow
Build: Prevent output from swallowing webpack errors
This commit is contained in:
commit
750d66a3b8
@ -2,6 +2,7 @@
|
||||
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const { isObject } = require('lodash');
|
||||
const webpackConfig = require('../webpack.config');
|
||||
const {
|
||||
getCorePluginsPath,
|
||||
@ -58,7 +59,20 @@ const buildAdmin = async () => {
|
||||
if (messages.errors.length > 1) {
|
||||
messages.errors.length = 1;
|
||||
}
|
||||
return reject(new Error(messages.errors.join('\n\n')));
|
||||
|
||||
return reject(
|
||||
new Error(
|
||||
messages.errors.reduce((acc, error) => {
|
||||
if (isObject(error)) {
|
||||
acc += error.message;
|
||||
} else {
|
||||
acc += error.join('\n\n');
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, '')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return resolve({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user