React Styleguidist for Irving.
This package contains an integration for React Styleguidist with Irving. All core components will
Installation
npm install @irvingjs/styleguide
- Create a
config/styleguide.config.js
file to act as an entry point for your styleguide. This file shouldimport createStyleguideConfig from '@irvingjs/styleguide'
and use that function to generate the config. You may pass in any number of additional configs to be merged into the base config, including configs from Irving packages. Example:
import createStyleguideConfig from '@irvingjs/styleguide';
import styledConfig from '@irvingjs/styled/config/styleguide.config.js';
const myConfig = {
title: 'This is my styleguide',
};
module.exports = createStyleGuideConfig(myConfig, styledConfig);
- You may call
createStyleguideConfig
with no parameters and the base config will be used as-is. - Proceed with caution if you intend to modify the
require
,styleguideComponents
,styleguideDir
, orwebpackConfig
config fields. Documentation on styleguidist configuration can be found here. - Update your
package.json
to include the styleguide scripts. Note these scripts should point to the config you created in step 2.
{
"scripts": {
"styleguide:build": "BABEL_ENV=app NODE_ENV=production npx styleguidist build --config ./config/styleguide.config.js",
"styleguide:dev": "BABEL_ENV=app NODE_ENV=development npx styleguidist server --config ./config/styleguide.config.js",
}
}