Skip to content

Commit cf96d84

Browse files
ortagaearon
authored andcommitted
[Dev] Adds module and bundle type metadata to the rollup results json (#11914)
1 parent 9ff3ce6 commit cf96d84

File tree

3 files changed

+261
-84
lines changed

3 files changed

+261
-84
lines changed

scripts/rollup/build.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ function getPlugins(
181181
externals,
182182
updateBabelOptions,
183183
filename,
184+
packageName,
184185
bundleType,
185186
globalName,
186187
moduleType,
@@ -263,11 +264,13 @@ function getPlugins(
263264
// Record bundle size.
264265
sizes({
265266
getSize: (size, gzip) => {
266-
const key = `${filename} (${bundleType})`;
267-
Stats.currentBuildResults.bundleSizes[key] = {
267+
Stats.currentBuildResults.bundleSizes.push({
268+
filename,
269+
bundleType,
270+
packageName,
268271
size,
269272
gzip,
270-
};
273+
});
271274
},
272275
}),
273276
].filter(Boolean);
@@ -352,6 +355,7 @@ async function createBundle(bundle, bundleType) {
352355
externals,
353356
bundle.babel,
354357
filename,
358+
packageName,
355359
bundleType,
356360
bundle.global,
357361
bundle.moduleType,

0 commit comments

Comments
 (0)