Skip to content

Commit 2f743e0

Browse files
committed
🐛 Fix hash duplicated without identify local name
1 parent 0400731 commit 2f743e0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/getLocalIdent.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ module.exports = function getLocalIdent(loaderContext, localIdentName, localName
1111
var resourcePath = loaderContext.resourcePath;
1212
var request = path.relative(options.context, resourcePath);
1313
options.content = options.hashPrefix + request;
14+
15+
if (!localIdentName.includes('[local]'))
16+
options.content += '+' + localName;
17+
1418
// @TODO: This is a temp solution because a function cannot be transfered through a loader string.
1519
if (/\.vue[\\/]module\.css$/.test(resourcePath)) {
1620
var vueName = path.basename(path.dirname(resourcePath), '.vue');
1721
localIdentName = localIdentName.replace(/\[name\]/gi, vueName);
1822
}
23+
1924
if(localName === 'root')
2025
localIdentName = localIdentName.replace(/_\[local\]/gi, '');
2126
else

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vusion-css-loader",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"author": "Tobias Koppers @sokra",
55
"description": "css loader module for webpack",
66
"engines": {

0 commit comments

Comments
 (0)