.umirc.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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: '/Levalthat',
  18. name: '等级说明',
  19. component: '../pages/Levalthat/Levalthat'
  20. },
  21. {
  22. path: '/closeinstructions',
  23. name: '亲密关系说明',
  24. component: '../pages/Closeinstruction/Closeinstruction'
  25. },
  26. {
  27. path: '/nobility',
  28. name: '贵族',
  29. component: '../layouts/BasicLayout',
  30. routes: [
  31. {
  32. path: '/nobility/home',
  33. name: '贵族',
  34. component: '../pages/MyNobility/MyNobility'
  35. },
  36. {
  37. path: '/nobility/explain',
  38. name: '贵族说明',
  39. component: '../pages/MyNobility/MyNobilityExplain'
  40. }
  41. ]
  42. },
  43. {
  44. path: '/vipinfo/home',
  45. name: '会员信息',
  46. component: '../pages/VipInfo/VipInfo'
  47. },
  48. {
  49. path: '/wallettime/home',
  50. name: '时间钱包',
  51. component: '../pages/WalletTime/WalletTime'
  52. },
  53. {
  54. path: '/wshop',
  55. name: '商城',
  56. component: '../layouts/BasicLayout',
  57. routes: [
  58. {
  59. path: '/wshop/home',
  60. name: '商城',
  61. component: '../pages/WalletShop/WalletShop'
  62. },
  63. {
  64. path: '/wshop/explain',
  65. name: '商城',
  66. component: '../pages/WalletShop/WalletShopExplain'
  67. },
  68. {
  69. path: '/wshop/record',
  70. name: '钻石商城',
  71. component: '../pages/WalletShop/BuyRecord'
  72. },
  73. ]
  74. },
  75. {
  76. path: '/crRanks/home',
  77. name: '全站榜',
  78. component: '../pages/Totalstation/Totalstation'
  79. },
  80. {
  81. path: '/crRanks/room',
  82. name: '房间榜',
  83. component: '../pages/CRRanksroom/Roomranks'
  84. },
  85. {
  86. path: '/realLoveRank',
  87. name: '真爱榜',
  88. component: '../pages/Realloverank'
  89. },
  90. {
  91. path: '/gasranks',
  92. name: '欧气榜',
  93. component: '../pages/Gasranks'
  94. },
  95. {
  96. path: '/crRanks/issue',
  97. name: '往期榜',
  98. component: '../pages/Issuranks/Issuranks'
  99. },
  100. {
  101. path: '/hlRanks/home',
  102. name: '热爱榜',
  103. component: '../pages/HotLoveRanks/CoinRanks'
  104. },
  105. {
  106. path: '/gRanks/home',
  107. name: '周星榜',
  108. component: '../pages/Weekstarranks/Weekstarranks'
  109. },
  110. {
  111. path: '/pkring/ranks',
  112. name: 'PK擂台榜',
  113. component: '../pages/Pkring'
  114. },
  115. {
  116. path: '/guardian/ranks',
  117. name: '守护榜',
  118. component: '../pages/Guardianranks'
  119. },
  120. {
  121. path: '/chatRoom',
  122. name: '房间流水',
  123. component: '../layouts/BasicLayout',
  124. routes: [
  125. {
  126. path: '/chatRoom/records',
  127. name: '房间流水',
  128. component: '../pages/CRRecords/CoinRecord'
  129. },
  130. {
  131. path: '/chatRoom/hours',
  132. name: '房间小时流水',
  133. component: '../pages/CRRecords/CoinRecordHours'
  134. }
  135. ]
  136. },
  137. {
  138. path: '/giftWall',
  139. name: '礼物墙',
  140. component: '../layouts/BasicLayout',
  141. routes: [
  142. {
  143. path: '/giftWall/home',
  144. name: '礼物墙',
  145. component: '../pages/GiftWall/GiftWall'
  146. },
  147. {
  148. path: '/giftWall/week',
  149. name: '本周礼物',
  150. component: '../pages/GiftWall/GiftWallWeek'
  151. }
  152. ]
  153. },
  154. {
  155. path: '/wallet',
  156. name: '钱包',
  157. component: '../layouts/BasicLayout',
  158. routes: [
  159. {
  160. path: '/wallet/transDiamond',
  161. name: '兑换钻石',
  162. component: '../pages/TransDiamond/TransDiamond'
  163. },
  164. {
  165. path: '/wallet/transDiamond/records',
  166. name: '兑换记录',
  167. component: '../pages/TransDiamond/TransDiamondRecords'
  168. }
  169. ]
  170. },
  171. {
  172. path: '/template',
  173. name: '模板',
  174. component: '../layouts/HalfScrnBasicLayout',
  175. routes: [
  176. {
  177. path: '/template/message',
  178. name: '资讯',
  179. component: '../pages/Template/Message'
  180. }
  181. ]
  182. },
  183. {
  184. path: '/login',
  185. name: '登录',
  186. component: '../pages/TestLogin/TestLogin'
  187. }
  188. ],
  189. plugins: [
  190. // ref: https://umijs.org/plugin/umi-plugin-react.html
  191. ['umi-plugin-react', {
  192. antd: true,
  193. dva: false,
  194. dynamicImport: false,
  195. title: '',
  196. dll: false,
  197. hd: true,
  198. routes: {
  199. exclude: [
  200. /components\//,
  201. ],
  202. },
  203. //CDN引入
  204. links: [
  205. { href: 'http://sp.qn.timichat.com/static/antd-mobile/2.3.1/antd-mobile.min.css', rel: 'stylesheet' }
  206. ],
  207. headScripts: [
  208. //react
  209. 'http://sp.qn.timichat.com/static/react/16.9.0/react.production.min.js',
  210. //react-dom
  211. 'http://sp.qn.timichat.com/static/react/16.9.0/react-dom.production.min.js',
  212. //antd-mobile
  213. 'http://sp.qn.timichat.com/static/antd-mobile/2.3.1/antd-mobile.min.js',
  214. //lottie动画
  215. 'http://sp.qn.timichat.com/static/bodymovin/5.6.8/lottie.min.js',
  216. //moment
  217. // 'http://sp.qn.timichat.com/static/moment/2.24.0/moment.min.js',
  218. //UAParser
  219. 'http://sp.qn.timichat.com/static/UAParser/0.7.21/ua-parser.min.js'
  220. ],
  221. locale: {
  222. default: 'zh-CN',
  223. antd: true
  224. }
  225. }],
  226. ],
  227. extraPostCSSPlugins: [
  228. autoprefixer({
  229. flexbox: true
  230. }),
  231. // px2rem({
  232. // rootValue: 75,
  233. // // propBlackList:['border','border-top','border-left','border-right','border-bottom','border-radius','font-size'], // 这些属性不需要转换
  234. // selectorBlackList:['t_npx']
  235. // })
  236. ],
  237. hash: true,
  238. // exportStatic: {
  239. // htmlSuffix: true
  240. // },
  241. extraBabelPlugins: [
  242. ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
  243. ],
  244. proxy: {
  245. '/api-app': {
  246. target: 'http://api.timichat.net',
  247. changeOrigin: true,
  248. //pathRewrite: { '^/server': '' },
  249. },
  250. '/api-manage': {
  251. target: 'http://api.timichat.net',
  252. changeOrigin: true,
  253. //pathRewrite: { '^/server': '' },
  254. },
  255. },
  256. // publicPath: '/themes/default/template/h5-activity/',
  257. publicPath: '/',
  258. outputPath: './inapp',
  259. copy: [
  260. {
  261. "from": "public",
  262. "to": ""
  263. }
  264. ],
  265. // publicPath: 'http://sp.qn.timichat.com/inapp/',
  266. externals: {
  267. 'react': 'React',
  268. 'react-dom': 'ReactDOM',
  269. 'antd-mobile': 'antd-mobile',
  270. 'lottie-web': 'lottie',
  271. // 'moment': 'moment',
  272. 'ua-parser-js': 'UAParser'
  273. },
  274. }