-
Notifications
You must be signed in to change notification settings - Fork 2
/
styleguide.config.js
33 lines (31 loc) · 993 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
// styleguide.config.js
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const webpackConfig = require('./config/webpack.config');
const webpackEnv = process.env.NODE_ENV;
const isEnvDevelopment = webpackEnv === 'development';
module.exports = {
webpackConfig: isEnvDevelopment ?
webpackConfig :
Object.assign({}, webpackConfig('production'), {
plugins: [
new MiniCssExtractPlugin({
filename: 'static/css/[name].[contenthash:8].css',
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
}),
],
}),
components: 'src/components/*/*.{jsx,tsx}',
usageMode: 'expand',
exampleMode: 'expand',
defaultExample: false,
styleguideComponents: {
Wrapper: path.join(__dirname, 'src/theme/ThemeWrapper'),
},
propsParser: require('react-docgen-typescript').withCustomConfig(
'./tsconfig.json',
{
shouldRemoveUndefinedFromOptional: true,
},
).parse,
};