config.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // https://umijs.org/config/
  2. import { defineConfig } from 'umi';
  3. import defaultSettings from './defaultSettings';
  4. import proxy from './proxy';
  5. import { iaaSystem, iaaData } from './routerConfig';
  6. // const CompressionWebpackPlugin = require('compression-webpack-plugin');
  7. const { REACT_APP_ENV } = process.env;
  8. export default defineConfig({
  9. history: {
  10. type: 'hash',
  11. },
  12. // 默认是 browse
  13. hash: true,
  14. antd: {
  15. // dark: true
  16. // compact: true, // 开启紧凑主题
  17. },
  18. dva: {
  19. hmr: true,
  20. },
  21. layout: {
  22. name: '趣程集团IAA业务应用数据系统',
  23. locale: false,
  24. siderWidth: 208,
  25. },
  26. locale: {
  27. // default zh-CN
  28. default: 'zh-CN',
  29. // default true, when it is true, will use `navigator.language` overwrite default
  30. antd: true,
  31. baseNavigator: true,
  32. },
  33. dynamicImport: {
  34. //按需加载组件
  35. loading: '@/components/PageLoading/index',
  36. },
  37. targets: {
  38. ie: 11,
  39. },
  40. // umi routes: https://umijs.org/docs/routing
  41. routes: [
  42. {
  43. path: '/user',
  44. layout: false,
  45. routes: [
  46. {
  47. name: 'login',
  48. path: '/user/login',
  49. component: './user/login',
  50. },
  51. ],
  52. },
  53. iaaSystem, // 后台管理
  54. iaaData, // IAA数据系统
  55. {
  56. path: '/',
  57. redirect: '/',
  58. },
  59. {
  60. component: './404',
  61. },
  62. ],
  63. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  64. theme: {
  65. // ...darkTheme,
  66. 'primary-color': defaultSettings.primaryColor,
  67. },
  68. // @ts-ignore
  69. title: false,
  70. ignoreMomentLocale: true,
  71. proxy: proxy[(REACT_APP_ENV || 'dev') as keyof typeof proxy],
  72. manifest: {
  73. basePath: '/',
  74. },
  75. });