forked from PostHog/posthog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
51 lines (43 loc) · 1.5 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
51
import { createEntry } from '../webpack.config'
import { StorybookConfig } from '@storybook/react-webpack5'
const config: StorybookConfig = {
stories: ['../frontend/src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
addons: [
'@storybook/addon-docs',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-storysource',
'@storybook/addon-a11y',
'storybook-addon-pseudo-states',
],
staticDirs: ['public', { from: '../frontend/public', to: '/static' }],
webpackFinal: (config) => {
const mainConfig = createEntry('main')
return {
...config,
resolve: {
...config.resolve,
extensions: [...config.resolve!.extensions!, ...mainConfig.resolve.extensions],
alias: { ...config.resolve!.alias, ...mainConfig.resolve.alias },
},
module: {
...config.module,
rules: [
...mainConfig.module.rules,
...(config.module?.rules?.filter(
(rule: any) => 'test' in rule && rule.test.toString().includes('.mdx')
) ?? []),
],
},
}
},
framework: {
name: '@storybook/react-webpack5',
options: { builder: { useSWC: true } },
},
docs: {
autodocs: 'tag',
},
typescript: { reactDocgen: 'react-docgen' }, // Shouldn't be needed in Storybook 8
}
export default config