config.ts 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-09-03 14:28:27
  4. * @LastEditTime: 2024-09-06 16:42:12
  5. * @LastEditors: code4eat awesomedema@gmail.com
  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. console.log({'REACT_APP_ENV_pfmview':REACT_APP_ENV});
  17. export default defineConfig({
  18. hash: true,
  19. antd:{
  20. config:{
  21. prefixCls: 'mwc-ant',
  22. // getPopupContainer:(triggerNode:HTMLElement)=>triggerNode
  23. }
  24. },
  25. lessLoader: {
  26. modifyVars: { '@ant-prefix': 'mwc-ant' }
  27. }, //对应修改生成的 antd 样式类名
  28. dva: {
  29. hmr: true,
  30. },
  31. layout: {
  32. // https://umijs.org/zh-CN/plugins/plugin-layout
  33. locale: false,
  34. siderWidth: 208,
  35. ...defaultSettings,
  36. },
  37. dynamicImport: {
  38. loading: '@ant-design/pro-layout/es/PageLoading',
  39. },
  40. targets: {
  41. ie: 11,
  42. },
  43. routes,
  44. theme: {
  45. 'primary-color': defaultSettings.primaryColor,
  46. '@ant-prefix': 'mwc-ant'
  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. publicPath: REACT_APP_ENV == 'development' ? '/' : '/pfmview/',
  58. autoprefixer:{
  59. },
  60. // Fast Refresh 热更新
  61. fastRefresh: {},
  62. openAPI: [
  63. {
  64. requestLibPath: "import { request } from 'umi'",
  65. // 或者使用在线的版本
  66. // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
  67. schemaPath: join(__dirname, 'oneapi.json'),
  68. mock: false,
  69. },
  70. {
  71. requestLibPath: "import { request } from 'umi'",
  72. schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
  73. projectName: 'swagger',
  74. },
  75. ],
  76. nodeModulesTransform: { type: 'none' },
  77. // mfsu: {
  78. // // production: { output: '.mfsu-production' }
  79. // },
  80. // webpack5: {
  81. // },
  82. exportStatic: {},
  83. qiankun: {
  84. slave: {},
  85. },
  86. });