Skip to content

Commit

Permalink
Strip hash from chunk file name (#3049)
Browse files Browse the repository at this point in the history
  • Loading branch information
esturcke authored and JohnNilsson committed Sep 9, 2017
1 parent 912a02e commit 563ff66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-dev-utils/FileSizeReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ function printFileSizesAfterBuild(
function removeFileNameHash(buildFolder, fileName) {
return fileName
.replace(buildFolder, '')
.replace(/\/?(.*)(\.\w+)(\.js|\.css)/, (match, p1, p2, p3) => p1 + p3);
.replace(
/\/?(.*)(\.[0-9a-f]+)(\.chunk)?(\.js|\.css)/,
(match, p1, p2, p3, p4) => p1 + p4
);
}

// Input: 1024, 2048
Expand Down

0 comments on commit 563ff66

Please sign in to comment.