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) {
|
if(showAssets) {
|
||||||
var assetsByFile = {};
|
var assetsByFile = {};
|
||||||
|
obj.assetsByChunkName = {};
|
||||||
obj.assets = Object.keys(compilation.assets).map(function(asset) {
|
obj.assets = Object.keys(compilation.assets).map(function(asset) {
|
||||||
var obj = {
|
var obj = {
|
||||||
name: asset,
|
name: asset,
|
||||||
|
|
@ -102,8 +103,10 @@ Stats.prototype.toJson = function toJson(options, forToString) {
|
||||||
chunk.ids.forEach(function(id) {
|
chunk.ids.forEach(function(id) {
|
||||||
assetsByFile[asset].chunks.push(id);
|
assetsByFile[asset].chunks.push(id);
|
||||||
});
|
});
|
||||||
if(chunk.name)
|
if(chunk.name) {
|
||||||
assetsByFile[asset].chunkNames.push(chunk.name);
|
assetsByFile[asset].chunkNames.push(chunk.name);
|
||||||
|
obj.assetsByChunkName[chunk.name] = asset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue