docs/api/main-config/main-config.mdx
The main configuration defines a Storybook project's behavior, including the location of stories, addons to use, feature flags, and other project-specific settings.
main.js or main.tsThis file must be valid ESM. In other words, it must use import instead of require, and neither __dirname nor __filename are available.
This configuration is defined in .storybook/main.js|ts, which is located relative to the root of your project.
A typical Storybook configuration file looks like this:
<CodeSnippets path="main-config-typical.md" />An object to configure Storybook containing the following properties:
framework (Required)stories (Required)addonsbabelbabelDefaultbuildcoredocsenvfeaturesindexers (⚠️ Experimental)logLevelmanagerHeadpreviewAnnotationspreviewBodypreviewHeadrefsstaticDirsswctagstypescriptviteFinalwebpackFinal