AFFiNE/packages/component/.storybook/main.ts

40 lines
1.0 KiB
TypeScript
Raw Normal View History

2023-02-14 06:18:43 +03:00
import type { StorybookConfig } from '@storybook/react-vite';
import { fileURLToPath } from 'node:url';
import { mergeConfig } from 'vite';
2023-04-04 02:13:43 +03:00
import tsconfigPaths from 'vite-tsconfig-paths';
2023-02-14 06:18:43 +03:00
export default {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
staticDirs: ['../../../apps/web/public'],
2023-03-11 08:15:19 +03:00
addons: [
'@storybook/addon-links',
'storybook-dark-mode',
2023-03-11 08:15:19 +03:00
'@storybook/addon-interactions',
],
2023-02-14 06:18:43 +03:00
framework: {
name: '@storybook/react-vite',
},
async viteFinal(config, { configType }) {
return mergeConfig(config, {
2023-04-04 02:13:43 +03:00
plugins: [
tsconfigPaths({
root: fileURLToPath(new URL('../../../', import.meta.url)),
}),
],
define: {
'process.env': {},
},
resolve: {
alias: {
'next/config': fileURLToPath(
new URL(
'../../../scripts/vitest/next-config-mock.ts',
import.meta.url
)
),
},
2023-02-14 06:18:43 +03:00
},
});
2023-02-14 06:18:43 +03:00
},
} as StorybookConfig;