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({
230230});
231231```
232232
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+
233238### ` mode ` string
234239
235240Short 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({
3434 prepend = [ ] ,
3535 createImportedName,
3636 generateScopedName,
37+ hashPrefix,
3738 mode,
3839 use,
3940 rootDir : context = process . cwd ( ) ,
@@ -51,7 +52,7 @@ module.exports = function setupHook({
5152 let scopedName ;
5253 if ( generateScopedName ) {
5354 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]'
5556 : generateScopedName ;
5657 } else {
5758 // small fallback
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const rules = {
1717 use : 'array' ,
1818 createImportedName : 'function' ,
1919 generateScopedName : 'function|string' ,
20+ hashPrefix : 'string' ,
2021 mode : 'string' ,
2122 rootDir : 'string' ,
2223} ;
You can’t perform that action at this time.
0 commit comments