mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-22 08:40:03 +01:00
f1d8b555f4
* test: Upgrade to Storybook 7.6 * Update UI snapshots for `chromium` (1) * Update UI snapshots for `chromium` (2) --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
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'],
|
|
|
|
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: {},
|
|
},
|
|
|
|
docs: {
|
|
autodocs: 'tag',
|
|
},
|
|
|
|
typescript: { reactDocgen: 'react-docgen' }, // Shouldn't be needed in Storybook 8
|
|
}
|
|
|
|
export default config
|