Skip to content

Commit 5932187

Browse files
committed
give information about chunk name to asset mapping
1 parent 6e7bd0c commit 5932187

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎lib/Stats.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Stats.prototype.toJson = function toJson(options, forToString) {
8585
}
8686
if(showAssets) {
8787
var assetsByFile = {};
88+
obj.assetsByChunkName = {};
8889
obj.assets = Object.keys(compilation.assets).map(function(asset) {
8990
var obj = {
9091
name: asset,
@@ -102,8 +103,10 @@ Stats.prototype.toJson = function toJson(options, forToString) {
102103
chunk.ids.forEach(function(id) {
103104
assetsByFile[asset].chunks.push(id);
104105
});
105-
if(chunk.name)
106+
if(chunk.name) {
106107
assetsByFile[asset].chunkNames.push(chunk.name);
108+
obj.assetsByChunkName[chunk.name] = asset;
109+
}
107110
}
108111
});
109112
});

0 commit comments

Comments
 (0)