config.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-09-03 14:28:27
  4. * @LastEditTime: 2022-01-01 13:13:35
  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. dynamicImport: {
  29. loading: '@ant-design/pro-layout/es/PageLoading',
  30. },
  31. targets: {
  32. ie: 11,
  33. },
  34. routes,
  35. theme: {
  36. 'primary-color': defaultSettings.primaryColor,
  37. },
  38. // esbuild is father build tools
  39. // https://umijs.org/plugins/plugin-esbuild
  40. esbuild: {},
  41. title: false,
  42. ignoreMomentLocale: true,
  43. proxy: proxy[REACT_APP_ENV || 'dev'],
  44. manifest: {
  45. basePath: '/',
  46. },
  47. autoprefixer:{
  48. },
  49. // Fast Refresh 热更新
  50. fastRefresh: {},
  51. openAPI: [
  52. {
  53. requestLibPath: "import { request } from 'umi'",
  54. // 或者使用在线的版本
  55. // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
  56. schemaPath: join(__dirname, 'oneapi.json'),
  57. mock: false,
  58. },
  59. {
  60. requestLibPath: "import { request } from 'umi'",
  61. schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
  62. projectName: 'swagger',
  63. },
  64. ],
  65. nodeModulesTransform: { type: 'none' },
  66. mfsu: {
  67. // production: { output: '.mfsu-production' }
  68. },
  69. // webpack5: {
  70. // },
  71. exportStatic: {},
  72. // qiankun: {
  73. // slave: {},
  74. // },
  75. });