config.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // https://umijs.org/config/
  2. import { defineConfig } from 'umi';
  3. import { join } from 'path';
  4. // import defaultSettings from './defaultSettings';
  5. import proxy from './proxy';
  6. import routes from './routes';
  7. const { REACT_APP_ENV } = process.env;
  8. export default defineConfig({
  9. hash: true,
  10. antd: {},
  11. dva: {
  12. hmr: true,
  13. },
  14. // layout: {
  15. // // https://umijs.org/zh-CN/plugins/plugin-layout
  16. // locale: true,
  17. // siderWidth: 208,
  18. // ...defaultSettings,
  19. // },
  20. layout: false,
  21. // https://umijs.org/zh-CN/plugins/plugin-locale
  22. locale: {
  23. // default zh-CN
  24. default: 'zh-CN',
  25. antd: true,
  26. // default true, when it is true, will use `navigator.language` overwrite default
  27. baseNavigator: true,
  28. },
  29. dynamicImport: {
  30. loading: '@ant-design/pro-layout/es/PageLoading',
  31. },
  32. targets: {
  33. ie: 11,
  34. },
  35. // umi routes: https://umijs.org/docs/routing
  36. routes,
  37. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  38. theme: {
  39. 'root-entry-name': 'variable',
  40. },
  41. // esbuild is father build tools
  42. // https://umijs.org/plugins/plugin-esbuild
  43. esbuild: {},
  44. title: false,
  45. ignoreMomentLocale: true,
  46. proxy: proxy[REACT_APP_ENV || 'dev'],
  47. manifest: {
  48. basePath: '/',
  49. },
  50. // Fast Refresh 热更新
  51. fastRefresh: {},
  52. openAPI: [
  53. {
  54. requestLibPath: "import { request } from 'umi'",
  55. // 或者使用在线的版本
  56. // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
  57. schemaPath: join(__dirname, 'oneapi.json'),
  58. mock: false,
  59. },
  60. {
  61. requestLibPath: "import { request } from 'umi'",
  62. schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
  63. projectName: 'swagger',
  64. },
  65. ],
  66. nodeModulesTransform: { type: 'none' },
  67. // mfsu: {},
  68. webpack5: {},
  69. exportStatic: {},
  70. });