Skip to content

Commit

Permalink
[Dev] Adds module and bundle type metadata to the rollup results json
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Dec 23, 2017
1 parent 9ff3ce6 commit 9db5565
Show file tree
Hide file tree
Showing 3 changed files with 261 additions and 84 deletions.
10 changes: 7 additions & 3 deletions scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ function getPlugins(
externals,
updateBabelOptions,
filename,
packageName,
bundleType,
globalName,
moduleType,
Expand Down Expand Up @@ -263,11 +264,13 @@ function getPlugins(
// Record bundle size.
sizes({
getSize: (size, gzip) => {
const key = `${filename} (${bundleType})`;
Stats.currentBuildResults.bundleSizes[key] = {
Stats.currentBuildResults.bundleSizes.push({
filename,
bundleType,
packageName,
size,
gzip,
};
});
},
}),
].filter(Boolean);
Expand Down Expand Up @@ -352,6 +355,7 @@ async function createBundle(bundle, bundleType) {
externals,
bundle.babel,
filename,
packageName,
bundleType,
bundle.global,
bundle.moduleType,
Expand Down
Loading

0 comments on commit 9db5565

Please sign in to comment.