2023-02-14 06:18:43 +03:00
|
|
|
import type { StorybookConfig } from '@storybook/react-vite';
|
2023-04-04 00:18:46 +03:00
|
|
|
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',
|
2023-04-04 00:18:46 +03:00
|
|
|
'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',
|
2023-04-04 00:18:46 +03:00
|
|
|
},
|
|
|
|
async viteFinal(config, { configType }) {
|
|
|
|
return mergeConfig(config, {
|
2023-04-04 02:13:43 +03:00
|
|
|
plugins: [
|
|
|
|
tsconfigPaths({
|
|
|
|
root: fileURLToPath(new URL('../../../', import.meta.url)),
|
|
|
|
}),
|
|
|
|
],
|
2023-04-04 00:18:46 +03:00
|
|
|
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-04-04 00:18:46 +03:00
|
|
|
});
|
2023-02-14 06:18:43 +03:00
|
|
|
},
|
|
|
|
} as StorybookConfig;
|