config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // https://umijs.org/config/
  2. import { defineConfig } from 'umi'
  3. import defaultSettings from './defaultSettings'
  4. import proxy from './proxy'
  5. import routes from './routes'
  6. const { REACT_APP_ENV } = process.env
  7. export default defineConfig({
  8. hash: true,
  9. antd: {},
  10. dva: {
  11. hmr: true
  12. },
  13. history: {
  14. type: 'browser'
  15. },
  16. locale: {
  17. // default zh-CN
  18. default: 'zh-CN',
  19. antd: false,
  20. // default true, when it is true, will use `navigator.language` overwrite default
  21. baseNavigator: false
  22. },
  23. dynamicImport: {
  24. loading: '@/components/PageLoading/index'
  25. },
  26. targets: {
  27. ie: 11
  28. },
  29. // umi routes: https://umijs.org/docs/routing
  30. routes,
  31. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  32. theme: {
  33. 'primary-color': defaultSettings.primaryColor
  34. },
  35. title: false,
  36. ignoreMomentLocale: true,
  37. proxy: proxy[REACT_APP_ENV || 'dev'],
  38. manifest: {
  39. basePath: '/'
  40. },
  41. exportStatic: {},
  42. esbuild: {},
  43. fastRefresh: {},
  44. extraBabelPlugins: [
  45. '@babel/plugin-proposal-nullish-coalescing-operator',
  46. '@babel/plugin-proposal-optional-chaining'
  47. ]
  48. })