Skip to content

Instantly share code, notes, and snippets.

@maestrow
Last active November 1, 2018 14:44
Show Gist options
  • Save maestrow/fcff732a6b7cba794048cf01880abc65 to your computer and use it in GitHub Desktop.
Save maestrow/fcff732a6b7cba794048cf01880abc65 to your computer and use it in GitHub Desktop.
Add styleguidist to non ejected create-react-app

How to Add styleguidist to non ejected create-react-app:

  • npm install --save-dev react-styleguidist react-docgen-typescript
  • create styleguide.config.js:
module.exports = {
  propsParser: require('react-docgen-typescript').parse,
  webpackConfig: require('react-scripts-ts/config/webpack.config.dev')
}
  • Run:
npx styleguidist server  # style guide dev server
npx styleguidist build   # build a production HTML version

Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment