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-links', '@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/addon-a11y' ], 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;