import { defineConfig } from 'dumi';

export default defineConfig({
    title: '@vtx/modals',
    favicon: '/favicon.ico',
    logo: '/favicon.ico',
    outputPath: 'docs-dist',
    mode: 'site',
    resolve: {
        includes: ['docs', 'src'],
    },
    base: '/vtx-modals',
    publicPath: '/vtx-modals/',
    exportStatic: {},
    navs: [
        null,
        {
            title: 'GitLab',
            path: 'https://git.cloudhw.cn:3443/front-end/business/vtx-modals',
        },
    ],
    extraBabelPlugins: [
        ['import', { libraryName: 'antd', style: true }, 'antd'],
        ['import', { libraryName: '@vtx/components', style: true }, 'vtx-components'],
        [
            'import',
            {
                libraryName: '@vtx/modals',
                libraryDirectory: 'lib',
                customStyleName: () => {
                    return `../style`;
                },
            },
            '@vtx/modals',
        ],
    ],
    styles: [
        `.__dumi-default-previewer-demo .ant-calendar-picker {margin-bottom: 10px}`,
        `.__dumi-default-previewer-demo .ant-time-picker {margin-bottom: 10px}`,
        `.markdown table td:nth-child(3) {color: #c41d7f;}`,
    ],
    chainWebpack(config: any) {
        // antd moment -> dayjs
        config.plugin('moment2dayjs').use('antd-dayjs-webpack-plugin');
    },
    locale: {
        default: 'zh-CN',
        antd: true,
        baseNavigator: false,
    },
    lessLoader: {
        modifyVars: {
            // 'root-entry-name': 'dark',
            'root-entry-name': 'default',
        },
    },
    proxy: {

        '/cloud/sdyd/kanban/v2': {
            target: 'http://10.10.11.45:8088/',
                changeOrigin: true,
        },
        '/cloud/': {
            target: 'http://tceam.dev.cloudhw.cn:8003/',
            changeOrigin: true,
        },
        '/aiFile/': {
            target: 'http://tceam.dev.cloudhw.cn:8003/',
            changeOrigin: true,
        },
    },
});
