-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstyleguide.config.js
39 lines (37 loc) · 992 Bytes
/
styleguide.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const path = require('path');
const webpackConfig = require('./webpack.config');
const { resolveLoader } = webpackConfig;
const { rules } = webpackConfig.module;
module.exports = {
assetsDir: 'static/',
components: 'client/{components,containers}/**/*.{js,jsx}',
getComponentPathLine(componentPath) {
const name = path.basename(componentPath, '.jsx');
const dir = path.dirname(componentPath).replace('client/', '');
return `import ${name} from '${dir}/${name}';`;
},
getExampleFilename(componentPath) {
return componentPath.replace(/\.jsx?$/, '.examples.md');
},
sections: [
{
name: 'UI Components',
components: 'client/components/**/*.jsx',
},
{
name: 'UI Containers',
components: 'client/containers/**/*.jsx',
},
],
styleguideComponents: {
Wrapper: path.join(__dirname, 'client/styleguidist/StyleguidistMuiWrapper'),
},
skipComponentsWithoutExample: true,
usageMode: 'expand',
webpackConfig: {
module: {
rules,
},
resolveLoader,
},
};