-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyleguide.config.js
48 lines (46 loc) · 1.26 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
43
44
45
46
47
48
const path = require('path')
module.exports = {
styleguideComponents: {
Wrapper: path.join(__dirname, 'styleguidist/Wrapper'),
},
styles: {
Playground: {
preview: {
position: 'relative',
marginTop: '15px',
},
},
},
require: [path.resolve(__dirname, 'styleguidist/setup.ts')],
skipComponentsWithoutExample: true,
components: 'packages/components/src/components/**/[A-Z]*.tsx',
propsParser: require('react-docgen-typescript').withCustomConfig('./tsconfig.json', {
// Фильтр для параметров которые определяются в реакте, что бы не захламлять документацию
propFilter: (prop, component) => {
if (prop.parent == null) {
return true
}
return prop.parent.fileName.indexOf('node_modules') < 0
},
}).parse,
webpackConfig: {
resolve: {
extensions: [ '.tsx', '.ts', '.js', '.json' ],
mainFields: ['browser', 'module', 'main'],
},
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
],
},
},
}