-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathmain.ts
38 lines (37 loc) · 1.29 KB
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import type { StorybookConfig } from '@storybook/react-vite';
import { dirname, join } from 'path';
/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')));
}
const config: StorybookConfig = {
// Display stories in the "stories" directory before others because
// we are putting stories related to src/packages in "stories", and we want
// to particularly encourage reuse of things that are already in published packages.
stories: [
'src/stories/Introduction.mdx',
'../src/stories/**/*.mdx',
'../src/stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
'../src/**/*.mdx',
'../src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-onboarding'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath('@storybook/addon-a11y'),
getAbsolutePath('@storybook/addon-designs'),
],
framework: {
name: getAbsolutePath('@storybook/react-vite'),
options: {},
},
docs: {
autodocs: 'tag',
},
};
export default config;