config.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // https://umijs.org/config/
  2. import { defineConfig } from 'umi';
  3. import defaultSettings from './defaultSettings';
  4. import proxy from './proxy';
  5. import routes from './routes';
  6. const { REACT_APP_ENV } = process.env;
  7. export default defineConfig({
  8. hash: true,
  9. antd: {},
  10. dva: {
  11. hmr: true,
  12. },
  13. layout: {
  14. name: '科德管理系统',
  15. locale: false,
  16. disableMobile: false,
  17. siderWidth: 208,
  18. ...defaultSettings,
  19. },
  20. locale: {
  21. // default zh-CN
  22. default: 'zh-CN',
  23. antd: false,
  24. // default true, when it is true, will use `navigator.language` overwrite default
  25. baseNavigator: true,
  26. },
  27. dynamicImport: {
  28. loading: '@ant-design/pro-layout/es/PageLoading',
  29. },
  30. targets: {
  31. ie: 11,
  32. },
  33. // umi routes: https://umijs.org/docs/routing
  34. routes,
  35. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  36. theme: {
  37. 'primary-color': defaultSettings.primaryColor,
  38. },
  39. esbuild: {},
  40. title: false,
  41. ignoreMomentLocale: true,
  42. proxy: proxy[REACT_APP_ENV || 'dev'],
  43. manifest: {
  44. basePath: '/',
  45. },
  46. // https://github.com/zthxxx/react-dev-inspector
  47. plugins: ['react-dev-inspector/plugins/umi/react-inspector'],
  48. inspectorConfig: {
  49. // loader options type and docs see below
  50. exclude: [],
  51. babelPlugins: [],
  52. babelOptions: {},
  53. },
  54. resolve: {
  55. includes: ['src/components'],
  56. },
  57. });