MCPcopy Index your code
hub / github.com/developit/microbundle / cssModulesConfig

Function cssModulesConfig

src/lib/css-modules.js:13–33  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

11}
12
13export 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",

Callers 1

createConfigFunction · 0.90

Calls 2

shouldCssModulesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…