mirror of https://github.com/webpack/webpack.git
Make stats version output configurable
This commit is contained in:
parent
e5cc07ec96
commit
ab630347ad
|
|
@ -24,6 +24,7 @@ Stats.prototype.toJson = function toJson(options, forToString) {
|
|||
var compilation = this.compilation;
|
||||
var requestShortener = new RequestShortener(d(options.context, process.cwd()));
|
||||
var showHash = d(options.hash, true);
|
||||
var showVersion = d(options.version, true);
|
||||
var showTimings = d(options.timings, true);
|
||||
var showAssets = d(options.assets, true);
|
||||
var showChunks = d(options.chunks, true);
|
||||
|
|
@ -75,11 +76,14 @@ Stats.prototype.toJson = function toJson(options, forToString) {
|
|||
return text;
|
||||
}
|
||||
var obj = {
|
||||
version: require("../package.json").version,
|
||||
errors: compilation.errors.map(formatError),
|
||||
warnings: compilation.warnings.map(formatError)
|
||||
};
|
||||
|
||||
if(showVersion) {
|
||||
obj.version = require("../package.json").version;
|
||||
}
|
||||
|
||||
if(showHash) obj.hash = this.hash;
|
||||
if(showTimings && this.startTime && this.endTime) {
|
||||
obj.time = this.endTime - this.startTime;
|
||||
|
|
|
|||
Loading…
Reference in New Issue