give information about chunk name to asset mapping

This commit is contained in:
Tobias Koppers 2014-03-31 08:46:04 +02:00
parent 6e7bd0c60b
commit 59321874df
1 changed files with 4 additions and 1 deletions

View File

@ -85,6 +85,7 @@ Stats.prototype.toJson = function toJson(options, forToString) {
}
if(showAssets) {
var assetsByFile = {};
obj.assetsByChunkName = {};
obj.assets = Object.keys(compilation.assets).map(function(asset) {
var obj = {
name: asset,
@ -102,8 +103,10 @@ Stats.prototype.toJson = function toJson(options, forToString) {
chunk.ids.forEach(function(id) {
assetsByFile[asset].chunks.push(id);
});
if(chunk.name)
if(chunk.name) {
assetsByFile[asset].chunkNames.push(chunk.name);
obj.assetsByChunkName[chunk.name] = asset;
}
}
});
});