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) {
|
if (fullLength > max) {
|
||||||
result = i > 0 ? errors.slice(0, i) : [];
|
result = i > 0 ? errors.slice(0, i) : [];
|
||||||
const overlimit = fullLength - max + 1;
|
const overlimit = fullLength - max + 1;
|
||||||
|
const error = errors[i++];
|
||||||
result.push({
|
result.push({
|
||||||
...errors[i++],
|
...error,
|
||||||
|
details: error.details.split("\n").slice(0, -overlimit).join("\n"),
|
||||||
filteredDetails: overlimit
|
filteredDetails: overlimit
|
||||||
});
|
});
|
||||||
filtered = errors.length - i;
|
filtered = errors.length - i;
|
||||||
|
|
|
@ -588,12 +588,7 @@ const SIMPLE_PRINTERS = {
|
||||||
"error.loc": (loc, { green }) => green(loc),
|
"error.loc": (loc, { green }) => green(loc),
|
||||||
"error.message": (message, { bold, formatError }) =>
|
"error.message": (message, { bold, formatError }) =>
|
||||||
message.includes("\u001b[") ? message : bold(formatError(message)),
|
message.includes("\u001b[") ? message : bold(formatError(message)),
|
||||||
"error.details": (details, { formatError, error }) => {
|
"error.details": (details, { formatError }) => formatError(details),
|
||||||
if (!error.filteredDetails) return formatError(details);
|
|
||||||
return formatError(
|
|
||||||
details.split("\n").slice(0, -error.filteredDetails).join("\n")
|
|
||||||
);
|
|
||||||
},
|
|
||||||
"error.filteredDetails": filteredDetails =>
|
"error.filteredDetails": filteredDetails =>
|
||||||
filteredDetails ? `+ ${filteredDetails} hidden lines` : undefined,
|
filteredDetails ? `+ ${filteredDetails} hidden lines` : undefined,
|
||||||
"error.stack": stack => stack,
|
"error.stack": stack => stack,
|
||||||
|
|
Loading…
Reference in New Issue