mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-06-15 18:08:15 +08:00
Strip hash from chunk file name (#3049)
This commit is contained in:
committed by
John Nilsson
parent
912a02ece0
commit
563ff66a92
5
packages/react-dev-utils/FileSizeReporter.js
vendored
5
packages/react-dev-utils/FileSizeReporter.js
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user