babel
¥Parent: main.js|ts configuration
类型:(config: Babel.Config, options: Options) => Babel.Config | Promise<Babel.Config>
¥Type: (config: Babel.Config, options: Options) => Babel.Config | Promise<Babel.Config>
自定义 Storybook 的 Babel 设置。
¥Customize Storybook's Babel setup.
插件作者 应该改用 babelDefault
,它在应用任何用户预设之前应用于预览配置。
¥Addon authors should use babelDefault
instead, which is applied to the preview config before any user presets have been applied.
Babel.Config
Babel 提供的选项仅在你启用了 @storybook/addon-webpack5-compiler-babel
插件时才适用。
¥The options provided by Babel are only applicable if you've enabled the @storybook/addon-webpack5-compiler-babel
addon.
如果你有现有的 Babel 配置文件(例如 .babelrc
),Storybook 将自动检测并使用它,而无需任何额外的配置。
¥If you have an existing Babel configuration file (e.g., .babelrc
), it will be automatically detected and used by Storybook without any additional configuration required.
Options
类型:{ configType?: 'DEVELOPMENT' | 'PRODUCTION' }
¥Type: { configType?: 'DEVELOPMENT' | 'PRODUCTION' }
还有其他难以在此处记录的选项。请自省类型定义以获取更多信息。
¥There are other options that are difficult to document here. Please introspect the type definition for more information.