.umirc.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. name: '太空旅行',
  10. redirect: '/travel/home'
  11. },
  12. {
  13. path: '/travel/home',
  14. name: '太空旅行',
  15. component: '../pages/GameTravel/GameTravel',
  16. },
  17. {
  18. path: '/travel/more',
  19. name: '更多',
  20. component: '../pages/GameTravel/PageMore',
  21. },
  22. {
  23. path: '/travel/rules',
  24. name: '旅行规则',
  25. component: '../pages/GameTravel/TravelRules',
  26. },
  27. {
  28. path: '/travel/gifts',
  29. name: '礼物清单',
  30. component: '../pages/GameTravel/TravelGiftList',
  31. },
  32. {
  33. path: '/travel/records',
  34. name: '旅行记录',
  35. component: '../pages/GameTravel/TravelRecords',
  36. },
  37. {
  38. path: '/travel/ranks',
  39. name: '旅行排行',
  40. component: '../pages/GameRanks/CoinRanks',
  41. },
  42. ],
  43. plugins: [
  44. // ref: https://umijs.org/plugin/umi-plugin-react.html
  45. ['umi-plugin-react', {
  46. antd: true,
  47. dva: false,
  48. dynamicImport: false,
  49. title: '',
  50. dll: false,
  51. hd: true,
  52. routes: {
  53. exclude: [
  54. /components\//,
  55. ],
  56. },
  57. //CDN引入
  58. links: [
  59. { href: 'http://sp.qn.paqukeji.com/static/antd-mobile/2.3.1/antd-mobile.min.css', rel: 'stylesheet' }
  60. ],
  61. headScripts: [
  62. //react
  63. 'http://sp.qn.paqukeji.com/static/react/16.9.0/react.production.min.js',
  64. //react-dom
  65. 'http://sp.qn.paqukeji.com/static/react/16.9.0/react-dom.production.min.js',
  66. //antd-mobile
  67. 'http://sp.qn.paqukeji.com/static/antd-mobile/2.3.1/antd-mobile.min.js',
  68. //lottie动画
  69. 'http://sp.qn.paqukeji.com/static/bodymovin/5.6.8/lottie.min.js',
  70. //moment
  71. 'http://sp.qn.paqukeji.com/static/moment/2.24.0/moment.min.js',
  72. //UAParser
  73. 'http://sp.qn.paqukeji.com/static/UAParser/0.7.21/ua-parser.min.js'
  74. ],
  75. locale: {
  76. default: 'zh-CN',
  77. antd: true
  78. }
  79. }],
  80. ],
  81. extraPostCSSPlugins: [
  82. // autoprefixer({
  83. // flexbox: true
  84. // }),
  85. // px2rem({
  86. // rootValue: 75,
  87. // // propBlackList:['border','border-top','border-left','border-right','border-bottom','border-radius','font-size'], // 这些属性不需要转换
  88. // selectorBlackList:['t_npx']
  89. // })
  90. ],
  91. extraBabelPlugins: [
  92. ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
  93. ],
  94. hash: true,
  95. // exportStatic: {
  96. // htmlSuffix: true
  97. // },
  98. proxy: {
  99. '/api-app': {
  100. target: 'http://api.starbuds.laylib.com',
  101. changeOrigin: true,
  102. //pathRewrite: { '^/server': '' },
  103. },
  104. '/api-common': {
  105. target: 'http://api.starbuds.laylib.com',
  106. changeOrigin: true,
  107. //pathRewrite: { '^/server': '' },
  108. },
  109. },
  110. outputPath: './travelgame',
  111. copy: [
  112. {
  113. "from": "public",
  114. "to": ""
  115. }
  116. ],
  117. publicPath: '', // 'http://sp.qn.paqukeji.com/jewelbox/',
  118. externals: {
  119. 'react': 'React',
  120. 'react-dom': 'ReactDOM',
  121. 'antd-mobile': 'antd-mobile',
  122. 'lottie-web': 'lottie',
  123. 'moment': 'moment',
  124. 'ua-parser-js': 'UAParser'
  125. },
  126. }