File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,11 @@ hook({
230
230
});
231
231
```
232
232
233
+ ### ` hashPrefix ` string
234
+
235
+ Short alias for the [ generic-names] ( https://github.com/css-modules/generic-names ) helper option.
236
+ Provides additional hash uniqueness. Might be useful for projects with several stylesheets sharing a same name.
237
+
233
238
### ` mode ` string
234
239
235
240
Short alias for the [ postcss-modules-local-by-default] ( https://github.com/css-modules/postcss-modules-local-by-default ) plugin's option.
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ module.exports = function setupHook({
34
34
prepend = [ ] ,
35
35
createImportedName,
36
36
generateScopedName,
37
+ hashPrefix,
37
38
mode,
38
39
use,
39
40
rootDir : context = process . cwd ( ) ,
@@ -51,7 +52,7 @@ module.exports = function setupHook({
51
52
let scopedName ;
52
53
if ( generateScopedName ) {
53
54
scopedName = typeof generateScopedName !== 'function'
54
- ? genericNames ( generateScopedName , { context} ) // for example '[name]__[local]___[hash:base64:5]'
55
+ ? genericNames ( generateScopedName , { context, hashPrefix } ) // for example '[name]__[local]___[hash:base64:5]'
55
56
: generateScopedName ;
56
57
} else {
57
58
// small fallback
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const rules = {
17
17
use : 'array' ,
18
18
createImportedName : 'function' ,
19
19
generateScopedName : 'function|string' ,
20
+ hashPrefix : 'string' ,
20
21
mode : 'string' ,
21
22
rootDir : 'string' ,
22
23
} ;
You can’t perform that action at this time.
0 commit comments