import { resolve } from 'node:path';

import { defineStorybookMain } from '@tale/ui/storybook/main';

export default defineStorybookMain({
  stories: ['../app/**/*.stories.@(ts|tsx)'],
  staticDirs: ['../public'],
  async viteFinal(viteConfig) {
    const { mergeConfig } = await import('vite');
    return mergeConfig(viteConfig, {
      resolve: {
        alias: {
          '@': resolve(import.meta.dirname, '..'),
        },
      },
    });
  },
});
