mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
28 lines
840 B
Plaintext
28 lines
840 B
Plaintext
```ts
|
|
// .storybook/main.ts
|
|
|
|
// Replace your-framework with the framework you are using (e.g., react-vite, vue3-vite)
|
|
import type { StorybookConfig } from '@storybook/your-framework';
|
|
|
|
const config: StorybookConfig = {
|
|
// Replace your-framework with the framework you are using (e.g., react-vite, vue3-vite)
|
|
framework: '@storybook/your-framework',
|
|
stories: ['../src/**/*.mdx', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
async viteFinal(config, { configType }) {
|
|
const { mergeConfig } = await import('vite');
|
|
|
|
if (configType === 'DEVELOPMENT') {
|
|
// Your development configuration goes here
|
|
}
|
|
if (configType === 'PRODUCTION') {
|
|
// Your production configuration goes here.
|
|
}
|
|
return mergeConfig(config, {
|
|
// Your environment configuration here
|
|
});
|
|
},
|
|
};
|
|
|
|
export default config;
|
|
```
|