Skip to content

Commit 76a4f80

Browse files
esturckethongdong7
authored andcommitted
Strip hash from chunk file name (facebook#3049)
1 parent 9bb966c commit 76a4f80

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-dev-utils/FileSizeReporter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ function printFileSizesAfterBuild(
9292
function removeFileNameHash(buildFolder, fileName) {
9393
return fileName
9494
.replace(buildFolder, '')
95-
.replace(/\/?(.*)(\.\w+)(\.js|\.css)/, (match, p1, p2, p3) => p1 + p3);
95+
.replace(
96+
/\/?(.*)(\.[0-9a-f]+)(\.chunk)?(\.js|\.css)/,
97+
(match, p1, p2, p3, p4) => p1 + p4
98+
);
9699
}
97100

98101
// Input: 1024, 2048

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy