mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 08:11:07 +08:00
25 lines
503 B
Plaintext
25 lines
503 B
Plaintext
```js
|
|
// .storybook/preview.js
|
|
|
|
import { initialize, mswDecorator } from 'msw-storybook-addon';
|
|
|
|
/*
|
|
* Initializes MSW
|
|
* See https://github.com/mswjs/msw-storybook-addon#configuring-msw
|
|
* to learn how to customize it
|
|
*/
|
|
initialize();
|
|
|
|
export const parameters = {
|
|
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
controls: {
|
|
matchers: {
|
|
color: /(background|color)$/i,
|
|
date: /Date$/,
|
|
},
|
|
},
|
|
};
|
|
|
|
// Provide the MSW addon decorator globally
|
|
export const decorators = [mswDecorator];
|
|
``` |