Skip to content

Commit 7d5916c

Browse files
committed
make child names relative
1 parent 732c85c commit 7d5916c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎lib/Stats.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
const RequestShortener = require("./RequestShortener");
88
const SizeFormatHelpers = require("./SizeFormatHelpers");
99
const formatLocation = require("./formatLocation");
10+
const identifierUtils = require("./util/identifier");
1011

1112
const optionOrFallback = (optionValue, fallbackValue) => typeof optionValue !== "undefined" ? optionValue : fallbackValue;
1213

@@ -80,7 +81,8 @@ class Stats {
8081
typeof options.all !== "undefined" ? options.all : def;
8182

8283
const compilation = this.compilation;
83-
const requestShortener = new RequestShortener(optionOrFallback(options.context, process.cwd()));
84+
const context = optionOrFallback(options.context, process.cwd());
85+
const requestShortener = new RequestShortener(context);
8486
const showPerformance = optionOrLocalFallback(options.performance, true);
8587
const showHash = optionOrLocalFallback(options.hash, true);
8688
const showVersion = optionOrLocalFallback(options.version, true);
@@ -391,7 +393,8 @@ class Stats {
391393
const obj = new Stats(child).toJson(childOptions, forToString);
392394
delete obj.hash;
393395
delete obj.version;
394-
obj.name = child.name;
396+
if(child.name)
397+
obj.name = identifierUtils.makePathsRelative(context, child.name, compilation.cache);
395398
return obj;
396399
});
397400
}

0 commit comments

Comments
 (0)