.umirc.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. import { defineConfig } from 'umi';
  2. export default defineConfig({
  3. nodeModulesTransform: {
  4. type: 'none',
  5. },
  6. plugins: ['@alitajs/hd'],
  7. hd: {
  8. theme: {},
  9. px2rem: {
  10. rootValue: 100,
  11. unitPrecision: 5,
  12. propWhiteList: [],
  13. propBlackList: [],
  14. exclude: false,
  15. selectorBlackList: [],
  16. ignoreIdentifier: false,
  17. replace: true,
  18. mediaQuery: true,
  19. minPixelValue: 0,
  20. },
  21. },
  22. extraBabelPlugins: [
  23. ['import', { libraryName: 'antd-mobile', style: true }], // `style: true` 会加载 less 文件
  24. ],
  25. routes: [
  26. { path: '/', component: '@/pages/index', title: '今夜你会不会来' },
  27. {
  28. path: '/downloadB',
  29. component: '@/pages/downloadB',
  30. title: '今夜你会不会来',
  31. },
  32. { path: '/success', component: '@/pages/Success', title: '成功' },
  33. {
  34. path: '/channel/center',
  35. component: '@/pages/MyInviteCenter/MyInviteCenter',
  36. title: '邀好友 赚收益',
  37. },
  38. {
  39. path: '/channel/record',
  40. component: '@/pages/MyInviteCenter/InviteRecord',
  41. title: '邀请明细',
  42. },
  43. {
  44. path: '/channel/banner',
  45. component: '@/pages/MyInviteCenter/Banner',
  46. title: '分享海报',
  47. },
  48. {
  49. path: '/security',
  50. component: '@/components/Security/Security',
  51. title: '人机校验',
  52. },
  53. {
  54. path: '/market',
  55. title: 'TiMi语音',
  56. component: '@/pages/Market.tsx',
  57. },
  58. {
  59. path: '/promote',
  60. title: 'TiMi语音',
  61. component: '@/pages/Promote.tsx',
  62. },
  63. ],
  64. proxy: {
  65. '/api-app': {
  66. target: 'http://api.timichat.net',
  67. //target: 'http://h5.paqukeji.com',
  68. changeOrigin: true,
  69. //pathRewrite: { '^/server': '' },
  70. },
  71. '/api-common': {
  72. target: 'http://api.timichat.net',
  73. //target: 'http://h5.paqukeji.com',
  74. changeOrigin: true,
  75. //pathRewrite: { '^/server': '' },
  76. },
  77. },
  78. hash: true,
  79. outputPath: './iv',
  80. //CDN引入
  81. links: [
  82. {
  83. href: '//sp.qn.timichat.cn/static/antd-mobile/2.3.1/antd-mobile.min.css',
  84. rel: 'stylesheet',
  85. },
  86. ],
  87. headScripts: [
  88. //react
  89. '//sp.qn.timichat.cn/static/react/16.9.0/react.production.min.js',
  90. //react-dom
  91. '//sp.qn.timichat.cn/static/react/16.9.0/react-dom.production.min.js',
  92. //antd-mobile
  93. '//sp.qn.timichat.cn/static/antd-mobile/2.3.1/antd-mobile.min.js',
  94. ],
  95. chainWebpack(config) {
  96. config.module
  97. .rule('mp4')
  98. .test(/\.(mp4|zip)(\?.*)?$/)
  99. .use('file-loader')
  100. .loader(require.resolve('file-loader'))
  101. .options({
  102. name: 'static/[name].[hash:8].[ext]',
  103. esModule: false,
  104. });
  105. },
  106. });