config.js 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. H5_URL:'http://h5.njyunzhi.com/state-grid/invoice-filling-h5/index.html',
  12. MODEL_URL:'https://h5.njyunzhi.com/assets/%E6%8A%A5%E9%94%80%E4%BA%BA%E5%91%98%E6%A8%A1%E6%9D%BF.xlsx'
  13. },
  14. base: '/', // 路由跳转必须加 admin
  15. publicPath: './', // 静态文件相对路径
  16. hash: true,
  17. history: {
  18. type: 'hash',
  19. },
  20. antd: {},
  21. dva: {
  22. hmr: true,
  23. },
  24. layout: {
  25. // https://umijs.org/zh-CN/plugins/plugin-layout
  26. locale: false,
  27. siderWidth: 208,
  28. ...defaultSettings,
  29. },
  30. // https://umijs.org/zh-CN/plugins/plugin-locale
  31. locale: {
  32. // default zh-CN
  33. default: 'zh-CN',
  34. antd: true,
  35. // default true, when it is true, will use `navigator.language` overwrite default
  36. baseNavigator: true,
  37. },
  38. dynamicImport: {
  39. loading: '@ant-design/pro-layout/es/PageLoading',
  40. },
  41. targets: {
  42. ie: 11,
  43. },
  44. // umi routes: https://umijs.org/docs/routing
  45. routes,
  46. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  47. theme: {
  48. 'root-entry-name': 'variable',
  49. },
  50. // esbuild is father build tools
  51. // https://umijs.org/plugins/plugin-esbuild
  52. esbuild: {},
  53. title: false,
  54. ignoreMomentLocale: true,
  55. proxy: proxy[REACT_APP_ENV || 'dev'],
  56. manifest: {
  57. basePath: '/',
  58. },
  59. // Fast Refresh 热更新
  60. fastRefresh: {},
  61. openAPI: [
  62. {
  63. requestLibPath: "import { request } from 'umi'",
  64. // 或者使用在线的版本
  65. // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
  66. schemaPath: join(__dirname, 'oneapi.json'),
  67. mock: false,
  68. },
  69. {
  70. requestLibPath: "import { request } from 'umi'",
  71. schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
  72. projectName: 'swagger',
  73. },
  74. ],
  75. nodeModulesTransform: {
  76. type: 'none',
  77. },
  78. // mfsu: {},
  79. webpack5: {},
  80. exportStatic: {},
  81. });