-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.ts
50 lines (41 loc) · 1.37 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
41
42
43
44
45
46
47
48
49
50
import { dirname, join } from 'path';
import type { StorybookConfig } from '@storybook/nextjs';
import path from 'path';
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
getAbsolutePath('@storybook/addon-onboarding'),
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@chromatic-com/storybook'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath('@storybook/addon-mdx-gfm'),
getAbsolutePath('@storybook/addon-storysource'),
],
framework: {
name: getAbsolutePath('@storybook/nextjs'),
options: {},
},
webpackFinal: async (config, { configType }) => {
const updatedConfig = {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve?.alias,
common: path.resolve(__dirname, '../src/common.scss'),
},
},
};
return updatedConfig;
},
staticDirs: ['../public'],
docs: {},
typescript: {
reactDocgen: 'react-docgen-typescript',
},
};
export default config;
function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')));
}