Skip to content

Commit

Permalink
Fix file size reporter on Windows (#5025)
Browse files Browse the repository at this point in the history
* fix FileSizeReporter in Windows enviroment

* chore: change line endings
  • Loading branch information
fiddep authored and Timer committed Sep 19, 2018
1 parent 9bbc177 commit f11bea1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-dev-utils/FileSizeReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function printFileSizesAfterBuild(
name: path.basename(asset.name),
size: size,
sizeLabel:
filesize(size) + (difference ? ' (' + difference + ')' : '')
filesize(size) + (difference ? ' (' + difference + ')' : ''),
};
})
)
Expand Down Expand Up @@ -98,6 +98,7 @@ function printFileSizesAfterBuild(
function removeFileNameHash(buildFolder, fileName) {
return fileName
.replace(buildFolder, '')
.replace(/\\/g, '/')
.replace(
/\/?(.*)(\.[0-9a-f]+)(\.chunk)?(\.js|\.css)/,
(match, p1, p2, p3, p4) => p1 + p4
Expand Down

0 comments on commit f11bea1

Please sign in to comment.