Skip to content

Commit

Permalink
Strip hash from chunk file name (facebook#3049)
Browse files Browse the repository at this point in the history
  • Loading branch information
esturcke authored and morgs32 committed Sep 5, 2017
1 parent 9e4fa1f commit 5a79dbf
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 5a79dbf

Please sign in to comment.