擴充功能
類型:(string | { name: string; options?: AddonOptions })[]
註冊 Storybook 載入的擴充功能。
如需每個擴充功能的可用選項,請參閱其各自的文件。
.storybook/main.ts
// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
import type { StorybookConfig } from '@storybook/your-framework';
const config: StorybookConfig = {
framework: '@storybook/your-framework',
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-essentials',
{
name: '@storybook/addon-styling-webpack',
options: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
implementation: require.resolve('postcss'),
},
},
],
},
],
},
},
],
};
export default config;