config.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-07-22 15:04:09
  4. * @LastEditTime: 2021-07-23 16:12:44
  5. * @LastEditors: Please set LastEditors
  6. * @Description: In User Settings Edit
  7. * @FilePath: /TracerMethodology_PC/config/config.js
  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: {
  74. type: 'none',
  75. },
  76. mfsu: {},
  77. webpack5: {},
  78. exportStatic: {},
  79. });