build(component): fix storybook config (#1798)
This commit is contained in:
1 parent
83000fa832
commit
b36588714e
5 files changed
+202
-66
No files matched your search
@@ -1,19 +1,33 @@
|
||||
import type { StorybookConfig } from '@storybook/react-vite';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { mergeConfig } from 'vite';
|
||||
|
||||
export default {
|
||||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
|
||||
staticDirs: ['../../../apps/web/public'],
|
||||
addons: [
|
||||
'@storybook/addon-links',
|
||||
'storybook-dark-mode-v7',
|
||||
'storybook-dark-mode',
|
||||
'@storybook/addon-interactions',
|
||||
],
|
||||
framework: {
|
||||
name: '@storybook/react-vite',
|
||||
options: {
|
||||
builder: {
|
||||
viteConfigPath: '.storybook/vite.config.ts',
|
||||
},
|
||||
async viteFinal(config, { configType }) {
|
||||
return mergeConfig(config, {
|
||||
define: {
|
||||
'process.env': {},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'next/config': fileURLToPath(
|
||||
new URL(
|
||||
'../../../scripts/vitest/next-config-mock.ts',
|
||||
import.meta.url
|
||||
)
|
||||
),
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
} as StorybookConfig;
|
||||
Reference in new issue
Block a user