mirror of https://github.com/webpack/webpack.git
give information about chunk name to asset mapping
This commit is contained in:
parent
6e7bd0c60b
commit
59321874df
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue