/*
 * @Author: your name
 * @Date: 2021-09-03 14:28:27
 * @LastEditTime: 2022-03-04 10:43:11
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /MedicalWisdomCheckSys/config/config.ts
 */
// https://umijs.org/config/
import { defineConfig } from 'umi';
import { join } from 'path';

import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';

const { REACT_APP_ENV } = process.env;

export default defineConfig({
  hash: true,
  antd:{
    config:{
      prefixCls: 'mwc-ant',
      // getPopupContainer:(triggerNode:HTMLElement)=>triggerNode
    }
  },
  lessLoader: {
    modifyVars: { '@ant-prefix': 'mwc-ant' } 
  }, //对应修改生成的 antd 样式类名
  dva: {
    hmr: true,
  },
  layout: {
    // https://umijs.org/zh-CN/plugins/plugin-layout
    locale: false,
    siderWidth: 208,
    ...defaultSettings,
  },
  dynamicImport: {
    loading: '@ant-design/pro-layout/es/PageLoading',
  },
  targets: {
    ie: 11,
  },

  routes,
  theme: {
    'primary-color': defaultSettings.primaryColor,
    '@ant-prefix': 'mwc-ant'
  },
  // esbuild is father build tools
  // https://umijs.org/plugins/plugin-esbuild
  esbuild: {},
  title: false,
  ignoreMomentLocale: true,
  proxy: proxy[REACT_APP_ENV || 'dev'],
  manifest: {
    basePath: '/',
  },
  autoprefixer:{

  },
  publicPath:'/',
  // Fast Refresh 热更新
  fastRefresh: {},
  openAPI: [
    {
      requestLibPath: "import { request } from 'umi'",
      // 或者使用在线的版本
      // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
      schemaPath: join(__dirname, 'oneapi.json'),
      mock: false,
    },
    {
      requestLibPath: "import { request } from 'umi'",
      schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
      projectName: 'swagger',
    },
  ],
  nodeModulesTransform: { type: 'none' },
  // mfsu: {
  //   // production: { output: '.mfsu-production' }
  // },
  // webpack5: {
  // },
  exportStatic: {},
  qiankun: {
    slave: {},
  },
});
