.umirc.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. component: '../layouts/index',
  10. routes: [
  11. {
  12. path: '/',
  13. redirect: '/popularize10',
  14. },
  15. {
  16. path: '/popularize01',
  17. name: '星芽',
  18. component: '../pages/Popularize01/Popularize01'
  19. },
  20. {
  21. path: '/popularize02',
  22. name: '星芽',
  23. component: '../pages/Popularize02/Popularize02'
  24. },
  25. {
  26. path: '/popularize03',
  27. name: '星芽',
  28. component: '../pages/Popularize03/Popularize03'
  29. },
  30. {
  31. path: '/popularize04',
  32. name: '星芽',
  33. component: '../pages/Popularize04/Popularize04'
  34. },
  35. {
  36. path: '/popularize05',
  37. name: '星芽',
  38. component: '../pages/Popularize05/Popularize05'
  39. },
  40. {
  41. path: '/popularize06',
  42. name: '星芽',
  43. component: '../pages/Popularize06/Popularize06'
  44. },
  45. {
  46. path: '/popularize07',
  47. name: '星芽',
  48. component: '../pages/Popularize07/Popularize07'
  49. },
  50. {
  51. path: '/popularize08',
  52. name: '星芽',
  53. component: '../pages/Popularize08/Popularize08'
  54. },
  55. {
  56. path: '/popularize09',
  57. name: '星芽',
  58. component: '../pages/Popularize09/Popularize09'
  59. },
  60. {
  61. path: '/tui_l',
  62. name: '星芽',
  63. component: '../pages/Popularize10/Popularize10'
  64. },
  65. {
  66. path: '/popularize10',
  67. name: '星芽',
  68. component: '../pages/Popularize10/Popularize10'
  69. },
  70. {
  71. path: '/popularize11',
  72. name: '星芽',
  73. component: '../pages/Popularize11/Popularize11'
  74. },
  75. {
  76. path: '/popularize12',
  77. name: '菠萝街',
  78. component: '../pages/Popularize12/DownloadBoluojie'
  79. }
  80. ]
  81. }
  82. ],
  83. plugins: [
  84. // ref: https://umijs.org/plugin/umi-plugin-react.html
  85. ['umi-plugin-react', {
  86. antd: true,
  87. dva: false,
  88. dynamicImport: false,
  89. title: '',
  90. dll: false,
  91. hd: false,
  92. routes: {
  93. exclude: [
  94. /components\//,
  95. ],
  96. },
  97. }]
  98. ],
  99. extraPostCSSPlugins: [
  100. autoprefixer({
  101. flexbox: true
  102. }),
  103. px2rem({
  104. rootValue: 37.5,
  105. // propBlackList:['border','border-top','border-left','border-right','border-bottom','border-radius','font-size'], // 这些属性不需要转换
  106. selectorBlackList: ['t_npx']
  107. }),
  108. ],
  109. extraBabelPlugins: [
  110. ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
  111. ],
  112. externals: {
  113. 'react': 'React',
  114. 'react-dom': 'ReactDOM',
  115. 'antd-mobile': 'antd-mobile'
  116. },
  117. hash: true,
  118. // exportStatic: {
  119. // htmlSuffix: true
  120. // },
  121. proxy: {
  122. '/api-app': {
  123. target: 'http://api.starbuds.laylib.com',
  124. //target: 'http://h5.paqukeji.com',
  125. changeOrigin: true,
  126. //pathRewrite: { '^/server': '' },
  127. },
  128. '/api-common': {
  129. target: 'http://api.starbuds.laylib.com',
  130. //target: 'http://h5.paqukeji.com',
  131. changeOrigin: true,
  132. //pathRewrite: { '^/server': '' },
  133. },
  134. },
  135. // publicPath: '/themes/default/template/h5-activity/',
  136. publicPath: '', // 'http://sp.qn.paqukeji.com/popularize/',
  137. outputPath: './popularize',
  138. copy: [
  139. {
  140. "from": "public",
  141. "to": ""
  142. }
  143. ],
  144. define: {
  145. 'PAGE_TYPE': 'starbuds'
  146. }
  147. }