Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 6b9d004

Browse files
committed
Move react-docgen to peer dependencies
1 parent b5c00d6 commit 6b9d004

File tree

3 files changed

+23
-715
lines changed

3 files changed

+23
-715
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,25 @@ storiesOf('Button')
3131
.add('simple', () => <Button>Smart knobed button</Button>)
3232

3333
```
34+
35+
## Configuration:
36+
37+
This plugin has a peer dependency on [babel-plugin-react-docgen
38+
](https://github.com/storybooks/babel-plugin-react-docgen). As a result, `babel-plugin-react-docgen` needs to be added to your Storybook Babel configuration.
39+
40+
For a standard Storybook configuration, add `react-docgen` to your plugins in an appropriate `.babelrc` file.
41+
42+
- [README | babel-plugin-react-docgen](https://github.com/storybooks/babel-plugin-react-docgen/blob/master/README.md)
43+
- [Custom Babel Config | Storybook](https://storybook.js.org/configurations/custom-babel-config/).
44+
45+
If you have created a `webpack.config.js` file for Storybook, you may need to configure the plugin in there.
46+
47+
```
48+
module.exports = (baseConfig, env, defaultConfig) => {
49+
defaultConfig.module.rules[0].use[0].options.plugins = [
50+
require.resolve('babel-plugin-react-docgen'),
51+
]
52+
53+
return defaultConfig
54+
}
55+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"@storybook/addon-options": "^4.1.1",
2828
"@storybook/react": "^4.1.1",
2929
"babel-loader": "^8.0.4",
30-
"babel-plugin-react-docgen": "^2.0.0",
3130
"css-loader": "^2.0.0",
3231
"eslint-config-taller": "^2.0.0",
3332
"eslint-plugin-flowtype": "^3.0.0",
@@ -41,6 +40,7 @@
4140
"@storybook/addon-knobs": "^4.1.1",
4241
"@storybook/addon-options": "^4.1.1",
4342
"@storybook/react": "^4.1.1",
43+
"babel-plugin-react-docgen": "^2.0.0",
4444
"react": ">=15.0.0 || ^16.0.0"
4545
}
4646
}

0 commit comments

Comments
 (0)