-
-
Notifications
You must be signed in to change notification settings - Fork 165
/
Copy pathmain.ts
40 lines (32 loc) · 1.02 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
39
40
import type { StorybookConfig } from '@storybook/react-native-web-vite';
import { join, dirname } 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) {
return dirname(require.resolve(join(value, 'package.json')));
}
type ServerStorybookConfig = StorybookConfig & {
reactNativeServerOptions: { host: string; port: number };
};
const main: ServerStorybookConfig = {
stories: ['../components/**/*.stories.?(ts|tsx|js|jsx)'],
addons: [
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-interactions'),
// note why does this break with get absolute?
'@storybook/addon-react-native-server',
'storybook-addon-deep-controls',
],
framework: {
name: '@storybook/react-native-web-vite',
options: {},
},
// logLevel: 'debug',
reactNativeServerOptions: {
host: 'localhost',
port: 7007,
},
};
export default main;