config.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-09-03 14:28:27
  4. * @LastEditTime: 2022-01-14 09:52:16
  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. config:{
  20. prefixCls: 'mwc-ant',
  21. // getPopupContainer:(triggerNode:HTMLElement)=>triggerNode
  22. }
  23. },
  24. lessLoader: {
  25. modifyVars: { '@ant-prefix': 'mwc-ant' }
  26. }, //对应修改生成的 antd 样式类名
  27. dva: {
  28. hmr: true,
  29. },
  30. layout: {
  31. // https://umijs.org/zh-CN/plugins/plugin-layout
  32. locale: false,
  33. siderWidth: 208,
  34. ...defaultSettings,
  35. },
  36. dynamicImport: {
  37. loading: '@ant-design/pro-layout/es/PageLoading',
  38. },
  39. targets: {
  40. ie: 11,
  41. },
  42. routes,
  43. theme: {
  44. 'primary-color': defaultSettings.primaryColor,
  45. '@ant-prefix': 'mwc-ant'
  46. },
  47. // esbuild is father build tools
  48. // https://umijs.org/plugins/plugin-esbuild
  49. esbuild: {},
  50. title: false,
  51. ignoreMomentLocale: true,
  52. proxy: proxy[REACT_APP_ENV || 'dev'],
  53. manifest: {
  54. basePath: '/',
  55. },
  56. autoprefixer:{
  57. },
  58. // Fast Refresh 热更新
  59. fastRefresh: {},
  60. openAPI: [
  61. {
  62. requestLibPath: "import { request } from 'umi'",
  63. // 或者使用在线的版本
  64. // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
  65. schemaPath: join(__dirname, 'oneapi.json'),
  66. mock: false,
  67. },
  68. {
  69. requestLibPath: "import { request } from 'umi'",
  70. schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
  71. projectName: 'swagger',
  72. },
  73. ],
  74. nodeModulesTransform: { type: 'none' },
  75. // mfsu: {
  76. // // production: { output: '.mfsu-production' }
  77. // },
  78. // webpack5: {
  79. // },
  80. exportStatic: {},
  81. qiankun: {
  82. slave: {},
  83. },
  84. });