Skip to content

Commit

Permalink
make child names relative
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jul 24, 2017
1 parent 732c85c commit 7d5916c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
const RequestShortener = require("./RequestShortener");
const SizeFormatHelpers = require("./SizeFormatHelpers");
const formatLocation = require("./formatLocation");
const identifierUtils = require("./util/identifier");

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

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

const compilation = this.compilation;
const requestShortener = new RequestShortener(optionOrFallback(options.context, process.cwd()));
const context = optionOrFallback(options.context, process.cwd());
const requestShortener = new RequestShortener(context);
const showPerformance = optionOrLocalFallback(options.performance, true);
const showHash = optionOrLocalFallback(options.hash, true);
const showVersion = optionOrLocalFallback(options.version, true);
Expand Down Expand Up @@ -391,7 +393,8 @@ class Stats {
const obj = new Stats(child).toJson(childOptions, forToString);
delete obj.hash;
delete obj.version;
obj.name = child.name;
if(child.name)
obj.name = identifierUtils.makePathsRelative(context, child.name, compilation.cache);
return obj;
});
}
Expand Down

0 comments on commit 7d5916c

Please sign in to comment.