Skip to content

Commit c096484

Browse files
Ben SolumBen Solum
Ben Solum
authored and
Ben Solum
committed
Added hook for sweatcss
1 parent 1298d2b commit c096484

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/getLocalIdent.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,13 @@ module.exports = function getLocalIdent(loaderContext, localIdentName, localName
1212
options.content = options.hashPrefix + request + "+" + localName;
1313
localIdentName = localIdentName.replace(/\[local\]/gi, localName);
1414
var hash = loaderUtils.interpolateName(loaderContext, localIdentName, options);
15-
return hash.replace(new RegExp("[^a-zA-Z0-9\\-_\u00A0-\uFFFF]", "g"), "-").replace(/^([^a-zA-Z_])/, "_$1");
15+
16+
return hash.split(/\[sweatcss\]/gi).map(function(H, i) {
17+
H = H.replace(new RegExp("[^a-zA-Z0-9\\-_\u00A0-\uFFFF]", "g"), "-").replace(/^([^a-zA-Z_])/, "_$1");
18+
19+
if(i % 2 == 1)
20+
H = 'SWEATCSS' + H;
21+
22+
return H;
23+
}).join('');
1624
};

0 commit comments

Comments
 (0)