config.js 1.9 KB

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