storybook/docs/api/main-config-preview-annotations.md
Kyle Gach 1d3262ee62 Address comments:
- Add `babelDefault` and `managerHead` pages
- Fix broken links
- Clarify when some properties are primarily used by addon authors
- Document simplified options for `babel`, `babelDefault`, `viteFinal`, and `webpackFinal`
- Add description for `core.channelOptions`
- Remove the `previewMainTemplate` page
- Document possible shortcomings of some `stories` configurations
- Document limitations of some `typescript` options
2023-05-23 14:15:53 -06:00

773 B

title
previewAnnotations

Parent: main.js|ts configuration

Type: string[] | ((config: string[], options: Options) => string[] | Promise<string[]>)

Add additional scripts to run in the story preview.

💡 Mostly used by frameworks. Storybook users and addon authors should add scripts to preview.js instead.

// @storybook/nextjs framework's src/preset.ts

import type { StorybookConfig } from './types';

export const previewAnnotations: StorybookConfig['previewAnnotations'] = (entry = []) => [
  ...entry,
  require.resolve('@storybook/nextjs/preview.js'),
];