Skip to content

Commit 7e4310a

Browse files
author
Even Alander
committed
add option to lib/Stats.js to disable stack trace on errors and warnings
1 parent 24ef6ea commit 7e4310a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Stats.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class Stats {
9595
const showProvidedExports = optionOrFallback(options.providedExports, !forToString);
9696
const showChildren = optionOrFallback(options.children, true);
9797
const showSource = optionOrFallback(options.source, !forToString);
98+
const showStackTrace = optionOrFallback(options.stackTrace, true);
9899
const showErrors = optionOrFallback(options.errors, true);
99100
const showErrorDetails = optionOrFallback(options.errorDetails, !forToString);
100101
const showWarnings = optionOrFallback(options.warnings, true);
@@ -164,7 +165,7 @@ class Stats {
164165
text += e.message;
165166
if(showErrorDetails && e.details) text += `\n${e.details}`;
166167
if(showErrorDetails && e.missing) text += e.missing.map(item => `\n[${item}]`).join("");
167-
if(e.dependencies && e.origin) {
168+
if(showStackTrace && e.dependencies && e.origin) {
168169
text += `\n @ ${e.origin.readableIdentifier(requestShortener)}`;
169170
e.dependencies.forEach(dep => {
170171
if(!dep.loc) return;

0 commit comments

Comments
 (0)