.umirc.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // import px2rem from 'postcss-plugin-px2rem'
  2. const autoprefixer = require('autoprefixer')
  3. // ref: https://umijs.org/config/
  4. export default {
  5. treeShaking: true,
  6. routes: [
  7. {
  8. path: '/',
  9. redirect: '/myleval/home'
  10. },
  11. {
  12. path: '/myleval/home',
  13. name: '我的等级',
  14. component: '../pages/MyLeval/MyLeval'
  15. },
  16. {
  17. path: '/nobility',
  18. name: '贵族',
  19. component: '../layouts/BasicLayout',
  20. routes: [
  21. {
  22. path: '/nobility/home',
  23. name: '贵族',
  24. component: '../pages/MyNobility/MyNobility'
  25. },
  26. {
  27. path: '/nobility/explain',
  28. name: '贵族说明',
  29. component: '../pages/MyNobility/MyNobilityExplain'
  30. }
  31. ]
  32. },
  33. {
  34. path: '/vipinfo/home',
  35. name: '会员信息',
  36. component: '../pages/VipInfo/VipInfo'
  37. },
  38. {
  39. path: '/login',
  40. name: '登录',
  41. component: '../pages/TestLogin/TestLogin'
  42. }
  43. ],
  44. plugins: [
  45. // ref: https://umijs.org/plugin/umi-plugin-react.html
  46. ['umi-plugin-react', {
  47. antd: true,
  48. dva: false,
  49. dynamicImport: false,
  50. title: '星芽',
  51. dll: false,
  52. hd: true,
  53. routes: {
  54. exclude: [
  55. /components\//,
  56. ],
  57. },
  58. }],
  59. ],
  60. extraPostCSSPlugins: [
  61. autoprefixer({
  62. flexbox: true
  63. }),
  64. // px2rem({
  65. // rootValue: 75,
  66. // // propBlackList:['border','border-top','border-left','border-right','border-bottom','border-radius','font-size'], // 这些属性不需要转换
  67. // selectorBlackList:['t_npx']
  68. // })
  69. ],
  70. hash: true,
  71. // exportStatic: {
  72. // htmlSuffix: true
  73. // },
  74. proxy: {
  75. '/api-app': {
  76. target: 'http://api.starbuds.laylib.com',
  77. changeOrigin: true,
  78. //pathRewrite: { '^/server': '' },
  79. },
  80. '/api-common': {
  81. target: 'http://api.starbuds.laylib.com',
  82. changeOrigin: true,
  83. //pathRewrite: { '^/server': '' },
  84. },
  85. },
  86. // publicPath: '/themes/default/template/h5-activity/',
  87. publicPath: '/',
  88. outputPath: './appbase',
  89. copy: [
  90. {
  91. "from": "public",
  92. "to": ""
  93. }
  94. ]
  95. }