Skip to content

Instantly share code, notes, and snippets.

@aga5tya
Last active February 1, 2018 10:01
Show Gist options
  • Save aga5tya/03a53332be01d79c33e81d543a562b77 to your computer and use it in GitHub Desktop.
Save aga5tya/03a53332be01d79c33e81d543a562b77 to your computer and use it in GitHub Desktop.
StyleGuide Config
// styleguidist.config.js
const loaders = require('loaders')
const webpack = require('webpack')
const path = require('path')
module.exports = {
/* Tells the styleguidist to scan the matched files to show in the environement */
components: 'src/components/**/[A-Z]*.js',
/* Base stub used for rendering */
template: 'src/common/index.html',
styleguideComponents: {
Wrapper: path.join(__dirname, 'src/common/Provider') /* This React component wraps each segregated component and gives access to fela library to render */
},
webpackConfig: {
module: {
/* Base loaders that inform styleguidist how to intepret a file. Styleguidist uses webpack under the hood as build tool. */
loaders: loaders.all
},
plugins: [
/* Typical environment variables set up to be accessed in the source */
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development')
},
__SERVER__: false,
__CLIENT__: true,
})
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment