mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
MIGRATE guide-preact documentation to triconfig
This commit is contained in:
parent
9acd5345c7
commit
62eed454e8
@ -47,16 +47,16 @@ Then add the following NPM script to your `package.json` in order to start the s
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 3: Create the config file
|
## Step 3: Create the main file
|
||||||
|
|
||||||
For a basic Storybook configuration, the only thing you need to do is tell Storybook where to find stories.
|
For a basic Storybook configuration, the only thing you need to do is tell Storybook where to find stories.
|
||||||
|
|
||||||
To do that, create a file at `.storybook/config.js` with the following content:
|
To do that, create a file at `.storybook/main.js` with the following content:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { configure } from '@storybook/preact';
|
module.exports {
|
||||||
|
stories: ['../src/**/*.stories.[tj]s'],
|
||||||
configure(require.context('../src', true, /\.stories\.js$/), module);
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
That will load all the stories underneath your `../src` directory that match the pattern `*.stories.js`. We recommend co-locating your stories with your source files, but you can place them wherever you choose.
|
That will load all the stories underneath your `../src` directory that match the pattern `*.stories.js`. We recommend co-locating your stories with your source files, but you can place them wherever you choose.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user