Skip to content

Commit 071dba1

Browse files
committed
Deal with .root class
1 parent 08e9d47 commit 071dba1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/getLocalIdent.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ module.exports = function getLocalIdent(loaderContext, localIdentName, localName
1010
options.context = loaderContext.options && typeof loaderContext.options.context === "string" ? loaderContext.options.context : loaderContext.context;
1111
var request = path.relative(options.context, loaderContext.resourcePath);
1212
options.content = options.hashPrefix + request + "+" + localName;
13-
localIdentName = localIdentName.replace(/\[local\]/gi, localName);
13+
// A temp solution
14+
if(localName === 'root')
15+
localIdentName = localIdentName.replace(/_\[local\]/gi, '');
16+
else
17+
localIdentName = localIdentName.replace(/\[local\]/gi, localName);
1418
var hash = loaderUtils.interpolateName(loaderContext, localIdentName, options);
1519
return hash.replace(new RegExp("[^a-zA-Z0-9\\-_\u00A0-\uFFFF]", "g"), "-").replace(/^((-?[0-9])|--)/, "_$1");
1620
};

0 commit comments

Comments
 (0)