Skip to content

Commit 101989a

Browse files
committed
feat: generate more collision resistant localIdentHash'es:
Avoid dashes in generated hash
1 parent c499529 commit 101989a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@ function defaultGetLocalIdent(
379379

380380
localIdentHash = (localIdentHash + hash.digest(hashDigest))
381381
.replace(/^\d+/, "")
382-
.slice(0, hashDigestLength)
383-
.replace(/\+/g, "-")
384-
.replace(/\//g, "_");
382+
.replace(/\//g, "_")
383+
.replace(/\W+/g, "")
384+
.slice(0, hashDigestLength);
385385
}
386386

387387
// TODO need improve on webpack side, we should allow to pass hash/contentHash without chunk property, also `data` for `getPath` should be looks good without chunk property

0 commit comments

Comments
 (0)