mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-15 00:05:35 +08:00
Add README
This commit is contained in:
parent
70ed244c7f
commit
c297e27197
33
addons/storysource/README.md
Normal file
33
addons/storysource/README.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Storybook Storysource Addon
|
||||||
|
|
||||||
|
This addon is used to show stories source in the addon panel.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
First, install the addon
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install -D @storybook/addon-storysource
|
||||||
|
```
|
||||||
|
|
||||||
|
Add this line to your `addons.js` file
|
||||||
|
|
||||||
|
```js
|
||||||
|
import '@storybook/addon-storysource/register';
|
||||||
|
```
|
||||||
|
|
||||||
|
Use this hook to a custom webpack.config. This will generate a decorator call in every story:
|
||||||
|
|
||||||
|
```js
|
||||||
|
module.exports = {
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.stories\.jsx?$/,
|
||||||
|
loaders: [require.resolve('@storybook/addon-storysource/loader')],
|
||||||
|
enforce: 'pre',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user