previewAnnotations
类型: string[] | ((config: string[], options: Options) => string[] | Promise<string[]>)
添加要在故事预览中运行的附加脚本。
主要由 框架 使用。Storybook 用户和 插件作者 应将脚本添加到 preview.js 中。
// @storybook/nextjs framework's src/preset.ts
import type { StorybookConfig } from './types';
export const previewAnnotations: StorybookConfig['previewAnnotations'] = (entry = []) => [
...entry,
import.meta.resolve('@storybook/nextjs/preview'),
];