框架
(必要)
類型:FrameworkName | { name: FrameworkName; options?: FrameworkOptions }
根據一組框架特定設定來設定 Storybook。
.storybook/main.ts
// Replace react-vite with the framework you are using (e.g., react-webpack5)
import type { StorybookConfig } from '@storybook/react-vite';
const config: StorybookConfig = {
framework: {
name: '@storybook/react-vite',
options: {
legacyRootApi: true,
},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
};
export default config;
name
類型:string
如需可用的框架及其選項,請參閱各自的文件。
options
類型:Record<string, any>
雖然許多選項是特定於框架的,但有些選項在某些框架之間是共用的,例如那些設定 Storybook 建構工具的選項。
options.builder
類型:Record<string, any>