MIGRATE guide-preact documentation to triconfig

This commit is contained in:
Norbert de Langen 2019-11-26 15:09:26 +01:00
parent 9acd5345c7
commit 62eed454e8

View File

@ -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.