config.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. import darkTheme from '@ant-design/dark-theme';
  7. const { REACT_APP_ENV } = process.env;
  8. export default defineConfig({
  9. hash: true,
  10. antd: {
  11. dark: true,// 暗黑模式
  12. compact: true, // 紧凑模式
  13. },
  14. dva: {
  15. hmr: true,
  16. },
  17. layout: {
  18. name: '科德管理系统',
  19. locale: false,
  20. siderWidth: 208,
  21. ...defaultSettings,
  22. },
  23. locale: {
  24. // default zh-CN
  25. default: 'zh-CN',
  26. antd: false,
  27. // default true, when it is true, will use `navigator.language` overwrite default
  28. baseNavigator: false,
  29. },
  30. dynamicImport: {
  31. loading: '@ant-design/pro-layout/es/PageLoading',
  32. },
  33. history: { type: 'hash' },
  34. publicPath: '/static/',
  35. targets: {
  36. ie: 11,
  37. },
  38. // umi routes: https://umijs.org/docs/routing
  39. routes,
  40. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  41. theme: {
  42. // ...darkTheme,
  43. // black: '#f00',//内容区背景颜色
  44. // 'popover-background': '#ff0',//侧边栏背景颜色
  45. // 'component-background': '#fff',//内容容器(比如搜索栏)背景颜色
  46. // 'table-header-bg': '#fff',//表格头部颜色
  47. 'primary-color': defaultSettings.primaryColor, //主题颜色
  48. },
  49. esbuild: {},
  50. title: false,
  51. ignoreMomentLocale: true,
  52. proxy: proxy[REACT_APP_ENV || 'dev'],
  53. manifest: {
  54. basePath: '/',
  55. },
  56. // https://github.com/zthxxx/react-dev-inspector
  57. plugins: ['react-dev-inspector/plugins/umi/react-inspector'],
  58. inspectorConfig: {
  59. // loader options type and docs see below
  60. exclude: [],
  61. babelPlugins: [],
  62. babelOptions: {},
  63. },
  64. resolve: {
  65. includes: ['src/components'],
  66. },
  67. });