Skip to content

Commit b60f55c

Browse files
fezhengjingaearon
authored andcommitted
Print file sizes with correct build folder path. (#2361)
* Print file sizes with correct build folder path. * Just use the print the basename.
1 parent 36e279d commit b60f55c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/react-dev-utils/FileSizeReporter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var stripAnsi = require('strip-ansi');
1818
var gzipSize = require('gzip-size').sync;
1919

2020
// Prints a detailed summary of build files.
21-
function printFileSizesAfterBuild(webpackStats, previousSizeMap) {
21+
function printFileSizesAfterBuild(webpackStats, previousSizeMap, buildFolder) {
2222
var root = previousSizeMap.root;
2323
var sizes = previousSizeMap.sizes;
2424
var assets = webpackStats
@@ -30,7 +30,7 @@ function printFileSizesAfterBuild(webpackStats, previousSizeMap) {
3030
var previousSize = sizes[removeFileNameHash(root, asset.name)];
3131
var difference = getDifferenceLabel(size, previousSize);
3232
return {
33-
folder: path.join('build', path.dirname(asset.name)),
33+
folder: path.join(path.basename(buildFolder), path.dirname(asset.name)),
3434
name: path.basename(asset.name),
3535
size: size,
3636
sizeLabel: filesize(size) + (difference ? ' (' + difference + ')' : ''),

packages/react-scripts/scripts/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ measureFileSizesBeforeBuild(paths.appBuild)
7575
}
7676

7777
console.log('File sizes after gzip:\n');
78-
printFileSizesAfterBuild(stats, previousFileSizes);
78+
printFileSizesAfterBuild(stats, previousFileSizes, paths.appBuild);
7979
console.log();
8080

8181
const appPackage = require(paths.appPackageJson);

0 commit comments

Comments
 (0)