1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. define: {
  10. API_BASE: 'http://invoice-filling.stategrid.njyunzhi.com',
  11. },
  12. base: '/', // 路由跳转必须加 admin
  13. publicPath: './', // 静态文件相对路径
  14. hash: true,
  15. history: {
  16. type: 'hash',
  17. },
  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. 'root-entry-name': 'variable',
  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. });