/*
 * @Author: cclu
 * @Date: 2021-12-13 11:01:23
 * @LastEditors: cclu 1106109051@qq.com
 * @LastEditTime: 2024-10-15 12:19:57
 * @FilePath: \cloud-platform\config\config.ts
 * @Description:
 *
 * Copyright (c) 2022 by cclu/杭州驿商科技, All Rights Reserved.
 */
// https://umijs.org/config/
import { defineConfig } from 'umi';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';

const { REACT_APP_ENV } = process.env;
const isDev = process.env.NODE_ENV === 'development';

export default defineConfig({
  hash: true,
  mock: false,
  antd: {},
  dva: {
    hmr: true
  },
  history: {
    type: REACT_APP_ENV === 'dev' ? "hash" : "memory",
    // type: "hash"
  },
  locale:
  {
    // default zh-CN
    default: 'zh-CN',
    antd: true,
    // default true, when it is true, will use `navigator.language` overwrite default
    baseNavigator: true,
  },
  dynamicImport: {
    loading: '@/components/SmartLoading/index',
  },
  targets: {
    ie: 11,
  },
  // umi routes: https://umijs.org/docs/routing
  routes,
  // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  theme: {
    // 'primary-color': defaultSettings.primaryColor,
    'primary-color': defaultSettings.primaryColor,
  },
  title: false,
  ignoreMomentLocale: true,
  proxy: proxy[REACT_APP_ENV || 'dev'],
  base: '/cloud',
  publicPath: process.env.NODE_ENV === 'development' ? '/' : '/cloud/',
  // 快速刷新功能 https://umijs.org/config#fastrefresh
  fastRefresh: {},
  esbuild: {},
  qiankun: {
    master: {}
  },
  webpack5: {
  }
});
