mirror of https://github.com/webpack/webpack.git
move details limiting back to factory
This commit is contained in:
parent
c14f1878ca
commit
ae9c63cadf
|
@ -1823,8 +1823,10 @@ const errorsSpaceLimit = (errors, max) => {
|
|||
if (fullLength > max) {
|
||||
result = i > 0 ? errors.slice(0, i) : [];
|
||||
const overlimit = fullLength - max + 1;
|
||||
const error = errors[i++];
|
||||
result.push({
|
||||
...errors[i++],
|
||||
...error,
|
||||
details: error.details.split("\n").slice(0, -overlimit).join("\n"),
|
||||
filteredDetails: overlimit
|
||||
});
|
||||
filtered = errors.length - i;
|
||||
|
|
|
@ -588,12 +588,7 @@ const SIMPLE_PRINTERS = {
|
|||
"error.loc": (loc, { green }) => green(loc),
|
||||
"error.message": (message, { bold, formatError }) =>
|
||||
message.includes("\u001b[") ? message : bold(formatError(message)),
|
||||
"error.details": (details, { formatError, error }) => {
|
||||
if (!error.filteredDetails) return formatError(details);
|
||||
return formatError(
|
||||
details.split("\n").slice(0, -error.filteredDetails).join("\n")
|
||||
);
|
||||
},
|
||||
"error.details": (details, { formatError }) => formatError(details),
|
||||
"error.filteredDetails": filteredDetails =>
|
||||
filteredDetails ? `+ ${filteredDetails} hidden lines` : undefined,
|
||||
"error.stack": stack => stack,
|
||||
|
|
Loading…
Reference in New Issue