Skip to content

Commit 9cb1057

Browse files
committed
generate shorter export names when using many exports
1 parent b7c746d commit 9cb1057

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)