config.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // https://umijs.org/config/
  2. import { defineConfig } from 'umi';
  3. import defaultSettings from './defaultSettings';
  4. import proxy from './proxy';
  5. import { operatePage, dataStatistics, launchSystem ,enterpriseWeChat} 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. enterpriseWeChat,//企业微信
  57. {
  58. path: '/',
  59. redirect: '/',
  60. },
  61. {
  62. component: './404',
  63. },
  64. ],
  65. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  66. theme: {
  67. // ...darkTheme,
  68. 'primary-color': defaultSettings.primaryColor,
  69. },
  70. // @ts-ignore
  71. title: false,
  72. ignoreMomentLocale: true,
  73. proxy: proxy[REACT_APP_ENV || 'dev'],
  74. manifest: {
  75. basePath: '/',
  76. },
  77. });