.umirc.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. publicPath: '/',
  53. routes: {
  54. exclude: [
  55. /components\//,
  56. ],
  57. },
  58. //CDN引入
  59. links: [
  60. { href: 'http://sp.qn.panygo.com/static/antd-mobile/2.3.1/antd-mobile.min.css', rel: 'stylesheet' }
  61. ],
  62. headScripts: [
  63. //react
  64. 'http://sp.qn.panygo.com/static/react/16.9.0/react.production.min.js',
  65. //react-dom
  66. 'http://sp.qn.panygo.com/static/react/16.9.0/react-dom.production.min.js',
  67. //antd-mobile
  68. 'http://sp.qn.panygo.com/static/antd-mobile/2.3.1/antd-mobile.min.js',
  69. //lottie动画
  70. 'http://sp.qn.panygo.com/static/bodymovin/5.6.8/lottie.min.js',
  71. //moment
  72. 'http://sp.qn.panygo.com/static/moment/2.24.0/moment.min.js',
  73. //UAParser
  74. 'http://sp.qn.panygo.com/static/UAParser/0.7.21/ua-parser.min.js'
  75. ],
  76. locale: {
  77. default: 'zh-CN',
  78. antd: true
  79. }
  80. }],
  81. ],
  82. extraPostCSSPlugins: [
  83. // autoprefixer({
  84. // flexbox: true
  85. // }),
  86. // px2rem({
  87. // rootValue: 75,
  88. // // propBlackList:['border','border-top','border-left','border-right','border-bottom','border-radius','font-size'], // 这些属性不需要转换
  89. // selectorBlackList:['t_npx']
  90. // })
  91. ],
  92. extraBabelPlugins: [
  93. ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
  94. ],
  95. hash: true,
  96. // exportStatic: {
  97. // htmlSuffix: true
  98. // },
  99. proxy: {
  100. '/api-app': {
  101. // target: 'http://api.starbuds.laylib.com',
  102. target: 'http://localhost:9201',
  103. changeOrigin: true,
  104. //pathRewrite: { '^/server': '' },
  105. },
  106. '/api-common': {
  107. // target: 'http://api.starbuds.laylib.com',
  108. target: 'http://localhost:9230',
  109. changeOrigin: true,
  110. //pathRewrite: { '^/server': '' },
  111. },
  112. },
  113. outputPath: './travelgame',
  114. copy: [
  115. {
  116. "from": "public",
  117. "to": ""
  118. }
  119. ],
  120. // 'http://sp.qn.panygo.com/jewelbox/',
  121. externals: {
  122. 'react': 'React',
  123. 'react-dom': 'ReactDOM',
  124. 'antd-mobile': 'antd-mobile',
  125. 'lottie-web': 'lottie',
  126. 'moment': 'moment',
  127. 'ua-parser-js': 'UAParser'
  128. },
  129. }