config.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-07-22 15:04:09
  4. * @LastEditTime: 2021-08-23 11:37:04
  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 {Settings as 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. // umi routes: https://umijs.org/docs/routing
  35. routes,
  36. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  37. theme: {
  38. 'primary-color':defaultSettings.primaryColor,
  39. },
  40. // esbuild is father build tools
  41. // https://umijs.org/plugins/plugin-esbuild
  42. esbuild: {},
  43. title: false,
  44. ignoreMomentLocale: true,
  45. proxy: proxy[REACT_APP_ENV || 'dev'],
  46. manifest: {
  47. basePath: '/',
  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: {
  66. type: 'none',
  67. },
  68. mfsu: {},
  69. webpack5: {},
  70. exportStatic: {},
  71. });