Parent: main.js|ts configuration
Type: (string | { from: string; to: string })[]
(string | { from: string; to: string })[]
Sets a list of directories of static files to be loaded by Storybook.
// 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)'], staticDirs: ['../public', '../static'], }; export default config;
You can also use a configuration object to define the directories:
// 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)'], staticDirs: [{ from: '../my-custom-assets/images', to: '/assets' }], }; export default config;