import { dirname, join, resolve } from 'node:path'; import type { StorybookConfig } from '@storybook/sveltekit'; import { mergeConfig } from 'vite'; const config: StorybookConfig = { stories: ['../stories/**/*.mdx', '../stories/**/*.stories.ts'], addons: [ '@storybook/addon-a11y', '@storybook/addon-essentials', '@storybook/addon-links', '@storybook/addon-interactions', '@storybook/addon-toolbar' ], core: { disableTelemetry: true }, framework: { name: '@storybook/sveltekit', options: {} }, docs: { autodocs: 'tag' }, async viteFinal(config) { const allowFiles = config.server?.fs?.allow || []; const storyFiles = resolve('stories'); return mergeConfig(config, { alias: { ...config.alias, $lib: resolve('..', 'src', 'lib') }, server: { ...config.server, fs: { ...config.server?.fs, allow: [...allowFiles, storyFiles] } } }); } }; export default config;