Skip to content

Commit

Permalink
Print file sizes with correct build folder path. (facebook#2361)
Browse files Browse the repository at this point in the history
* Print file sizes with correct build folder path.

* Just use the print the basename.
  • Loading branch information
fezhengjin authored and tuxsudo committed May 26, 2017
1 parent e7ce798 commit 76361fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/react-dev-utils/FileSizeReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var stripAnsi = require('strip-ansi');
var gzipSize = require('gzip-size').sync;

// Prints a detailed summary of build files.
function printFileSizesAfterBuild(webpackStats, previousSizeMap) {
function printFileSizesAfterBuild(webpackStats, previousSizeMap, buildFolder) {
var root = previousSizeMap.root;
var sizes = previousSizeMap.sizes;
var assets = webpackStats
Expand All @@ -30,7 +30,7 @@ function printFileSizesAfterBuild(webpackStats, previousSizeMap) {
var previousSize = sizes[removeFileNameHash(root, asset.name)];
var difference = getDifferenceLabel(size, previousSize);
return {
folder: path.join('build', path.dirname(asset.name)),
folder: path.join(path.basename(buildFolder), path.dirname(asset.name)),
name: path.basename(asset.name),
size: size,
sizeLabel: filesize(size) + (difference ? ' (' + difference + ')' : ''),
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ measureFileSizesBeforeBuild(paths.appBuild)
}

console.log('File sizes after gzip:\n');
printFileSizesAfterBuild(stats, previousFileSizes);
printFileSizesAfterBuild(stats, previousFileSizes, paths.appBuild);
console.log();

const appPackage = require(paths.appPackageJson);
Expand Down

0 comments on commit 76361fc

Please sign in to comment.