.umirc.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. component: '../pages/Popularize10/Popularize10',
  14. name: 'yaya'
  15. }
  16. ]
  17. }
  18. ],
  19. plugins: [
  20. // ref: https://umijs.org/plugin/umi-plugin-react.html
  21. ['umi-plugin-react', {
  22. antd: true,
  23. dva: false,
  24. dynamicImport: false,
  25. title: '',
  26. dll: false,
  27. hd: false,
  28. routes: {
  29. exclude: [
  30. /components\//,
  31. ],
  32. },
  33. }]
  34. ],
  35. extraPostCSSPlugins: [
  36. autoprefixer({
  37. flexbox: true
  38. }),
  39. px2rem({
  40. rootValue: 37.5,
  41. // propBlackList:['border','border-top','border-left','border-right','border-bottom','border-radius','font-size'], // 这些属性不需要转换
  42. selectorBlackList: ['t_npx']
  43. }),
  44. ],
  45. extraBabelPlugins: [
  46. ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
  47. ],
  48. // externals: {
  49. // 'react': 'React',
  50. // 'react-dom': 'ReactDOM',
  51. // 'antd-mobile': 'antd-mobile'
  52. // },
  53. hash: true,
  54. // exportStatic: {
  55. // htmlSuffix: true
  56. // },
  57. proxy: {
  58. '/api-app': {
  59. target: 'http://api.starbuds.laylib.com',
  60. //target: 'http://h5.paqukeji.com',
  61. changeOrigin: true,
  62. //pathRewrite: { '^/server': '' },
  63. },
  64. '/api-common': {
  65. target: 'http://api.starbuds.laylib.com',
  66. //target: 'http://h5.paqukeji.com',
  67. changeOrigin: true,
  68. //pathRewrite: { '^/server': '' },
  69. },
  70. },
  71. // publicPath: '/themes/default/template/h5-activity/',
  72. publicPath: '', // 'http://sp.qn.paqukeji.com/popularize/',
  73. outputPath: './popularize',
  74. copy: [
  75. {
  76. "from": "public",
  77. "to": ""
  78. }
  79. ]
  80. }