config.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // https://umijs.org/config/
  2. import { defineConfig } from 'umi';
  3. import defaultSettings from './defaultSettings';
  4. import proxy from './proxy';
  5. import { adMonitor, launchSystem } 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: '趣程管理后台',
  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. // operatePage, //运营配置
  54. // dataStatistics, //数据中心配置
  55. launchSystem, // 投放系统
  56. adMonitor, // 广告监控
  57. // enterpriseWeChat,//企业微信
  58. {
  59. path: '/',
  60. redirect: '/',
  61. },
  62. {
  63. component: './404',
  64. },
  65. ],
  66. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  67. theme: {
  68. // ...darkTheme,
  69. 'primary-color': defaultSettings.primaryColor,
  70. },
  71. // @ts-ignore
  72. title: false,
  73. ignoreMomentLocale: true,
  74. proxy: proxy[REACT_APP_ENV || 'dev'],
  75. manifest: {
  76. basePath: '/',
  77. },
  78. });