Skip to content

Commit

Permalink
build: fix class renaming in usage data
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Jun 21, 2016
1 parent 59923ed commit ce4a2e8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/build/css/optimizeNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ function toBase52(num){
'tmpl-overhead': 0
};

function getClassNameReplace(name){
function getClassNameReplace(name, baseName, postfix){
if (!hasOwnProperty.call(classReplaceMap, name))
classReplaceMap[name] = toBase52(classReplaceMapIdx++);
{
classReplaceMap[name] = name != baseName
? getClassNameReplace(baseName, baseName) + postfix
: toBase52(classReplaceMapIdx++);
}

return classReplaceMap[name];
}

Expand Down Expand Up @@ -68,7 +73,7 @@ function toBase52(num){
}

var list = classMap[name];
var replace = getClassNameReplace(list.name) + list.postfix;
var replace = getClassNameReplace(name, list.name, list.postfix);
var saving = 0;

for (var i = 0, item, token, tokenSaving; item = list[i]; i++)
Expand Down

0 comments on commit ce4a2e8

Please sign in to comment.