config.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-09-03 14:28:27
  4. * @LastEditTime: 2021-09-16 09:44:48
  5. * @LastEditors: Please set LastEditors
  6. * @Description: In User Settings Edit
  7. * @FilePath: /MedicalWisdomCheckSys/config/config.ts
  8. */
  9. // https://umijs.org/config/
  10. import { defineConfig } from 'umi';
  11. import { join } from 'path';
  12. import defaultSettings from './defaultSettings';
  13. import proxy from './proxy';
  14. import routes from './routes';
  15. const { REACT_APP_ENV } = process.env;
  16. export default defineConfig({
  17. hash: true,
  18. antd: {},
  19. dva: {
  20. hmr: true,
  21. },
  22. layout: {
  23. // https://umijs.org/zh-CN/plugins/plugin-layout
  24. locale: false,
  25. siderWidth: 208,
  26. ...defaultSettings,
  27. },
  28. // https://umijs.org/zh-CN/plugins/plugin-locale
  29. // locale: {
  30. // // default zh-CN
  31. // default: 'zh-CN',
  32. // antd: true,
  33. // // default true, when it is true, will use `navigator.language` overwrite default
  34. // baseNavigator: true,
  35. // },
  36. dynamicImport: {
  37. loading: '@ant-design/pro-layout/es/PageLoading',
  38. },
  39. targets: {
  40. ie: 11,
  41. },
  42. // umi routes: https://umijs.org/docs/routing
  43. routes,
  44. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  45. theme: {
  46. 'primary-color': defaultSettings.primaryColor,
  47. },
  48. // esbuild is father build tools
  49. // https://umijs.org/plugins/plugin-esbuild
  50. esbuild: {},
  51. title: false,
  52. ignoreMomentLocale: true,
  53. proxy: proxy[REACT_APP_ENV || 'dev'],
  54. manifest: {
  55. basePath: '/',
  56. },
  57. // Fast Refresh 热更新
  58. fastRefresh: {},
  59. openAPI: [
  60. {
  61. requestLibPath: "import { request } from 'umi'",
  62. // 或者使用在线的版本
  63. // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
  64. schemaPath: join(__dirname, 'oneapi.json'),
  65. mock: false,
  66. },
  67. {
  68. requestLibPath: "import { request } from 'umi'",
  69. schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
  70. projectName: 'swagger',
  71. },
  72. ],
  73. nodeModulesTransform: { type: 'none' },
  74. mfsu: {},
  75. webpack5: {},
  76. exportStatic: {},
  77. });