mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 01:31:48 +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.
|
||||
|
||||
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
|
||||
import { configure } from '@storybook/preact';
|
||||
|
||||
configure(require.context('../src', true, /\.stories\.js$/), module);
|
||||
module.exports {
|
||||
stories: ['../src/**/*.stories.[tj]s'],
|
||||
};
|
||||
```
|
||||
|
||||
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