import type { StorybookConfig } from "@storybook/vue3-vite";
import {mergeConfig} from "vite";
import vueConfig from "../vite.config";

const config: StorybookConfig = {
    "stories": ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
    "addons": [
        "@storybook/addon-links",
        "@storybook/addon-essentials",
        "@storybook/addon-interactions",
    ],
    core: {
      builder: '@storybook/builder-vite'
    },
    "framework": {
        name: "@storybook/vue3-vite",
        options: {}
    },
    async viteFinal(config) {
        // Merge custom configuration into the default config
        return mergeConfig(config, {
            // Use the same "resolve" configuration as your app
            resolve: vueConfig.resolve,
            // Add dependencies to pre-optimization
            optimizeDeps: {
                // include: ['storybook-dark-mode'],
            }
        });
    },
    "features": {
        "storyStoreV7": true
    },
    docs: {
        autodocs: true
    }
};

export default config;
