.umirc.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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: '/wallettime/home',
  40. name: '时间钱包',
  41. component: '../pages/WalletTime/WalletTime'
  42. },
  43. {
  44. path: '/wshop',
  45. name: '星元商城',
  46. component: '../layouts/BasicLayout',
  47. routes: [
  48. {
  49. path: '/wshop/home',
  50. name: '星元商城',
  51. component: '../pages/WalletShop/WalletShop'
  52. },
  53. {
  54. path: '/wshop/explain',
  55. name: '星元商城',
  56. component: '../pages/WalletShop/WalletShopExplain'
  57. },
  58. {
  59. path: '/wshop/record',
  60. name: '星元商城',
  61. component: '../pages/WalletShop/BuyRecord'
  62. },
  63. ]
  64. },
  65. {
  66. path: '/crRanks/home',
  67. name: '排行榜',
  68. component: '../pages/CRRanks/CoinRanks'
  69. },
  70. {
  71. path: '/chatRoom/records',
  72. name: '房间流水',
  73. component: '../pages/CRRecords/CoinRecord'
  74. },
  75. {
  76. path: '/giftWall',
  77. name: '礼物墙',
  78. component: '../layouts/BasicLayout',
  79. routes: [
  80. {
  81. path: '/giftWall/home',
  82. name: '礼物墙',
  83. component: '../pages/GiftWall/GiftWall'
  84. },
  85. {
  86. path: '/giftWall/week',
  87. name: '本周礼物',
  88. component: '../pages/GiftWall/GiftWallWeek'
  89. }
  90. ]
  91. },
  92. {
  93. path: '/wallet',
  94. name: '钱包',
  95. component: '../layouts/BasicLayout',
  96. routes: [
  97. {
  98. path: '/wallet/transDiamond',
  99. name: '兑换星钻',
  100. component: '../pages/TransDiamond/TransDiamond'
  101. },
  102. {
  103. path: '/wallet/transDiamond/records',
  104. name: '兑换记录',
  105. component: '../pages/TransDiamond/TransDiamondRecords'
  106. }
  107. ]
  108. },
  109. {
  110. path: '/login',
  111. name: '登录',
  112. component: '../pages/TestLogin/TestLogin'
  113. }
  114. ],
  115. plugins: [
  116. // ref: https://umijs.org/plugin/umi-plugin-react.html
  117. ['umi-plugin-react', {
  118. antd: true,
  119. dva: false,
  120. dynamicImport: false,
  121. title: '',
  122. dll: false,
  123. hd: true,
  124. routes: {
  125. exclude: [
  126. /components\//,
  127. ],
  128. },
  129. //CDN引入
  130. links: [
  131. { href: 'http://sp.qn.paqukeji.com/static/antd-mobile/2.3.1/antd-mobile.min.css', rel: 'stylesheet' }
  132. ],
  133. headScripts: [
  134. //react
  135. 'http://sp.qn.paqukeji.com/static/react/16.9.0/react.production.min.js',
  136. //react-dom
  137. 'http://sp.qn.paqukeji.com/static/react/16.9.0/react-dom.production.min.js',
  138. //antd-mobile
  139. 'http://sp.qn.paqukeji.com/static/antd-mobile/2.3.1/antd-mobile.min.js',
  140. //lottie动画
  141. 'http://sp.qn.paqukeji.com/static/bodymovin/5.6.8/lottie.min.js',
  142. //moment
  143. 'http://sp.qn.paqukeji.com/static/moment/2.24.0/moment.min.js',
  144. //UAParser
  145. 'http://sp.qn.paqukeji.com/static/UAParser/0.7.21/ua-parser.min.js'
  146. ],
  147. locale: {
  148. default: 'zh-CN',
  149. antd: true
  150. }
  151. }],
  152. ],
  153. extraPostCSSPlugins: [
  154. autoprefixer({
  155. flexbox: true
  156. }),
  157. // px2rem({
  158. // rootValue: 75,
  159. // // propBlackList:['border','border-top','border-left','border-right','border-bottom','border-radius','font-size'], // 这些属性不需要转换
  160. // selectorBlackList:['t_npx']
  161. // })
  162. ],
  163. hash: true,
  164. // exportStatic: {
  165. // htmlSuffix: true
  166. // },
  167. proxy: {
  168. '/api-app': {
  169. target: 'http://api.starbuds.laylib.com',
  170. changeOrigin: true,
  171. //pathRewrite: { '^/server': '' },
  172. },
  173. '/api-common': {
  174. target: 'http://api.starbuds.laylib.com',
  175. changeOrigin: true,
  176. //pathRewrite: { '^/server': '' },
  177. },
  178. },
  179. // publicPath: '/themes/default/template/h5-activity/',
  180. publicPath: '/',
  181. outputPath: './inapp',
  182. copy: [
  183. {
  184. "from": "public",
  185. "to": ""
  186. }
  187. ],
  188. // publicPath: 'http://sp.qn.paqukeji.com/inapp/',
  189. externals: {
  190. 'react': 'React',
  191. 'react-dom': 'ReactDOM',
  192. 'antd-mobile': 'antd-mobile',
  193. 'lottie-web': 'lottie',
  194. 'moment': 'moment',
  195. 'ua-parser-js': 'UAParser'
  196. },
  197. }