Skip to content

Commit 40871b8

Browse files
authored
Merge pull request webpack#5779 from webpack/improvement/shorter-mangle
generate shorter export names when using many exports
2 parents ccdba7b + 9cb1057 commit 40871b8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎lib/Template.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ module.exports = class Template extends Tapable {
7070
n -= DELTA_A_TO_Z;
7171
if(n < DELTA_A_TO_Z) return String.fromCharCode(START_UPPERCASE_ALPHABET_CODE + n);
7272

73-
// fall back to _ + number
74-
n -= DELTA_A_TO_Z;
75-
return "_" + n;
73+
// use multiple letters
74+
return Template.numberToIdentifer(n % (2 * DELTA_A_TO_Z)) + Template.numberToIdentifer(Math.floor(n / (2 * DELTA_A_TO_Z)));
7675
}
7776

7877
indent(str) {

0 commit comments

Comments
 (0)