config.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // https://umijs.org/config/
  2. import { defineConfig } from 'umi'
  3. import routes from './routes'
  4. export default defineConfig({
  5. hash: true,
  6. antd: {},
  7. sass: {},
  8. // dva: {
  9. // hmr: true,
  10. // disableModelsReExport: true,
  11. // lazyLoad: true,
  12. // },
  13. history: {
  14. type: 'hash',
  15. },
  16. locale: {
  17. // default zh-CN
  18. default: 'zh-CN',
  19. antd: true,
  20. // default true, when it is true, will use `navigator.language` overwrite default
  21. baseNavigator: true,
  22. },
  23. dynamicImport: {
  24. loading: '@/components/PageLoading/index',
  25. },
  26. define: {
  27. PORT: 4300,
  28. GENERATE_SOURCEMAP: false,
  29. REACT_APP_LOCALE: 'zh-Hans',
  30. REACT_APP_APP_BASE_URL: 'http://localhost:4200',
  31. // REACT_APP_MATERIAL_UPLOAD_URL: 'http://192.168.50.44:21022/api/Material/Upload',
  32. // REACT_APP_REMOTE_SERVICE_BASE_URL: 'http://192.168.50.44:21022',
  33. REACT_APP_MATERIAL_UPLOAD_URL: 'http://localhost:21028/api/Material/Upload',
  34. REACT_APP_MATERIAL_ZIP_URL: 'http://localhost:21028/api/Material/UploadZip',
  35. REACT_APP_REMOTE_SERVICE_BASE_URL: 'http://localhost:21028',
  36. // REACT_APP_WEIXIN_APPID: 'wx331ff3da84697769',
  37. REACT_APP_WEIXIN_APPID: 'wx9788037ac9f7521e',
  38. REACT_APP_SITE_NAME: '欢画',
  39. REACT_APP_SITE_SHORT_NAME: '欢画',
  40. REACT_APP_SITE_THEME: 'dark',
  41. UMI_ENV: 'huanart',
  42. },
  43. copy: [
  44. {
  45. from: 'node_modules/@aspnet/signalr/dist/browser/signalr.min.js',
  46. to: 'signalr.min.js',
  47. },
  48. {
  49. from: 'node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.signalr-client.js',
  50. to: 'abp.signalr-client.js',
  51. },
  52. { from: 'src/lib/abp.js', to: 'abp.js' },
  53. { from: 'src/assets/sites', to: 'assets/sites' },
  54. { from: 'src/assets/model', to: 'assets/model' },
  55. { from: 'src/assets/theme', to: 'assets/theme' },
  56. ],
  57. targets: {
  58. ie: 11,
  59. },
  60. // umi routes: https://umijs.org/docs/routing
  61. routes,
  62. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  63. theme: {
  64. 'primary-color': '#b69665',
  65. 'tabs-vertical-margin': '8px 0 0 0',
  66. 'tabs-vertical-padding': '4px',
  67. },
  68. title: false,
  69. ignoreMomentLocale: true,
  70. manifest: {
  71. basePath: '/',
  72. },
  73. // 快速刷新功能 https://umijs.org/config#fastrefresh
  74. fastRefresh: {},
  75. // esbuild: {},
  76. // webpack5: {},
  77. // mfsu: {},
  78. //
  79. plugins: [],
  80. analyze: {
  81. analyzerMode: 'server',
  82. analyzerPort: 8888,
  83. openAnalyzer: true,
  84. // generate stats file while ANALYZE_DUMP exist
  85. generateStatsFile: false,
  86. statsFilename: 'stats.json',
  87. logLevel: 'info',
  88. defaultSizes: 'parsed', // stat // gzip
  89. },
  90. chainWebpack(memo, { env, webpack, createCSSRule }) {
  91. memo.module
  92. .rule('mjs$')
  93. .test(/.mjs$/)
  94. .include.add(/node_modules/)
  95. .end()
  96. .type('javascript/auto')
  97. },
  98. })