forked from component-driven/ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styleguide.config.js
42 lines (40 loc) · 1.08 KB
/
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
40
41
42
const path = require('path')
const { createConfig } = require('@webpack-blocks/webpack')
const babel = require('@webpack-blocks/babel')
module.exports = {
sections: [
{
name: 'Components',
components: 'packages/**/[A-Z]*.js',
sectionDepth: 1
},
{
name: 'Utilities',
components: 'packages/**/mixins.js',
sectionDepth: 1
}
],
webpackConfig: createConfig([babel()]),
getExampleFilename(componentPath) {
return path.join(path.dirname(componentPath), '..', 'Readme.md')
},
getComponentPathLine(componentPath) {
const name = path.basename(componentPath, '.js')
const packageJSON = require(path.join(
__dirname,
path.dirname(componentPath),
'..',
'package.json'
))
return `import ${name} from ${packageJSON.name}`
},
exampleMode: 'expand',
usageMode: 'expand',
showSidebar: true,
ribbon: {
// Link to open on the ribbon click (required)
url: 'https://github.com/component-driven/react-focus-utils',
// Text to show on the ribbon (optional)
text: 'Fork me on GitHub'
}
}