(options)
| 11 | } |
| 12 | |
| 13 | export function cssModulesConfig(options) { |
| 14 | const passedInOption = processCssmodulesArgument(options); |
| 15 | const isWatchMode = options.watch; |
| 16 | const hasPassedInScopeName = !( |
| 17 | typeof passedInOption === 'boolean' || passedInOption === null |
| 18 | ); |
| 19 | |
| 20 | if (shouldCssModules(options) || hasPassedInScopeName) { |
| 21 | let generateScopedName = isWatchMode |
| 22 | ? '_[name]__[local]__[hash:base64:5]' |
| 23 | : '_[hash:base64:5]'; |
| 24 | |
| 25 | if (hasPassedInScopeName) { |
| 26 | generateScopedName = passedInOption; // would be the string from --css-modules "_[hash]". |
| 27 | } |
| 28 | |
| 29 | return { generateScopedName }; |
| 30 | } |
| 31 | |
| 32 | return false; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * This is done because if you use the cli default property, you get a primiatve "null" or "false", |
no test coverage detected
searching dependent graphs…