storybook/docs/api/main-config-core.md
Kyle Gach 8cac168f06 Update main.js|ts snippets for consistency
- Use `main-config-<property>-description` format, if possible
- Use "your-framework" wherever possible
- Always include `framework` & `stories` properties
- Remove unnecessary properties
2023-05-23 14:15:53 -06:00

2.3 KiB

title
core

Parent: main.js|ts configuration

Type:

{
  builder?: string | { name: string; options?: BuilderOptions };
  channelOptions?: ChannelOptions;
  crossOriginIsolated?: boolean;
  disableProjectJson?: boolean;
  disableTelemetry?: boolean;
  disableWebpackDefaults?: boolean;
  enableCrashReports?: boolean;
  renderer?: RendererName;
}

Configures Storybook's internal features.

<CodeSnippets paths={[ 'common/main-config-core.js.mdx', 'common/main-config-core.ts.mdx', ]} />

builder

Type:

| '@storybook/builder-vite' | '@storybook/builder-webpack5'
| {
    name: '@storybook/builder-vite' | '@storybook/builder-webpack5';
    options?: BuilderOptions;
  }

Configures Storybook's builder, Vite or Webpack.

channelOptions

Type: ChannelOptions

{
  allowRegExp: boolean;
  allowFunction: boolean;
  allowSymbol: boolean;
  allowDate: boolean;
  allowUndefined: boolean;
  allowClass: boolean;
  maxDepth: number;
  space: number | undefined;
  lazyEval: boolean;
}

crossOriginIsolated

Type: boolean

Enable CORS headings to run document in a "secure context". See SharedArrayBuffer security requirements

This enables these headers in development-mode:

  • Cross-Origin-Opener-Policy: same-origin
  • Cross-Origin-Embedder-Policy: require-corp

disableProjectJson

Type: boolean

Disables the generation of project.json, a file containing Storybook metadata

disableTelemetry

Type: boolean

Disables Storybook's telemetry collection.

disableWebpackDefaults

Type: boolean

Disables Storybook's default Webpack configuration.

enableCrashReports

Type: boolean

Enable crash reports to be sent to Storybook telemetry.

<CodeSnippets paths={[ 'common/main-config-core-enable-crash-reports.js.mdx', 'common/main-config-core-enable-crash-reports.ts.mdx', ]} />

renderer

Type: RendererName