Skip to content

Commit b0dbd5f

Browse files
authored
Prefix hashes with underscores based on CSS spec
To match with https://github.com/webpack/css-loader/blob/master/lib/getLocalIdent.js#L15
1 parent 61a09b1 commit b0dbd5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ module.exports = function createGenerator(pattern, options) {
4141
var genericName = interpolateName(loaderContext, name, loaderOptions);
4242
return genericName
4343
.replace(new RegExp('[^a-zA-Z0-9\\-_\u00A0-\uFFFF]', 'g'), '-')
44-
.replace(/^([^a-zA-Z_])/, '_$1');
44+
.replace(/^((-?[0-9])|--)/, "_$1");
4545
};
4646
};

0 commit comments

Comments
 (0)