.umirc.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // ref: https://umijs.org/config/
  2. export default {
  3. treeShaking: true,
  4. routes: [
  5. {
  6. path: '/page/videoDetail',
  7. component: '../pages/Video/VideoDetail'
  8. },
  9. {
  10. path: '/',
  11. component: '../layouts/index',
  12. routes: [
  13. { path: '/', component: '../pages/Live' },
  14. { path: '/download', component: '../pages/Download/Download' },
  15. { path: '/avdownload', component: '../pages/SexyDownload/SexyDownload' },
  16. { path: '/tui_l', component: '../pages/SexyDownload/SexyDownload' },
  17. { path: '/download/channel', component: '../pages/Download/Download2' },
  18. { path: '/video', component: '../pages/Video/VideoDetail' },
  19. { path: '/recharge', component: '../pages/Recharge/Recharge' },
  20. { path: '/recharge/login', component: '../pages/Recharge/RechargeLogin' }
  21. ]
  22. }
  23. ],
  24. plugins: [
  25. // ref: https://umijs.org/plugin/umi-plugin-react.html
  26. ['umi-plugin-react', {
  27. antd: false,
  28. dva: true,
  29. dynamicImport: false,
  30. title: '',
  31. dll: false,
  32. hd: true,
  33. routes: {
  34. exclude: [
  35. /models\//,
  36. /services\//,
  37. /model\.(t|j)sx?$/,
  38. /service\.(t|j)sx?$/,
  39. /components\//,
  40. ],
  41. },
  42. headScripts: [
  43. //react
  44. '//sp.qn.timichat.com/static/react/16.9.0/react.production.min.js',
  45. //react-dom
  46. '//sp.qn.timichat.com/static/react/16.9.0/react-dom.production.min.js',
  47. //antd-mobile
  48. '//sp.qn.timichat.com/static/antd-mobile/2.3.1/antd-mobile.min.js',
  49. // //lottie动画
  50. // '//sp.qn.timichat.com/static/bodymovin/5.6.8/lottie.min.js'
  51. ],
  52. //CDN引入
  53. links: [
  54. { href: '//sp.qn.timichat.com/static/antd-mobile/2.3.1/antd-mobile.min.css', rel: 'stylesheet' }
  55. ],
  56. }],
  57. ],
  58. lessLoaderOptions: {
  59. javascriptEnabled: true,
  60. },
  61. extraBabelPlugins: [
  62. ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
  63. ],
  64. define: {
  65. 'process.env': process.env
  66. },
  67. proxy: {
  68. '/api-app': {
  69. target: 'http://h5.timichat.net',//测试
  70. // target: 'http://h5.timichat.com',//正式
  71. changeOrigin: true,
  72. //pathRewrite: { '^/server': '' },
  73. },
  74. '/api-common': {
  75. //target: 'http://api.starbuds.laylib.com',
  76. target: 'http://h5.timichat.net',
  77. changeOrigin: true,
  78. //pathRewrite: { '^/server': '' },
  79. },
  80. '/wx': {
  81. target: 'https://api.weixin.qq.com',
  82. //target: 'http://h5.paqukeji.com',
  83. changeOrigin: true,
  84. pathRewrite: { '^/wx': '' },
  85. },
  86. },
  87. hash: true,
  88. outputPath: './wxpay',
  89. publicPath: '/',
  90. externals: {
  91. 'react': 'React',
  92. 'react-dom': 'ReactDOM',
  93. 'antd-mobile': 'antd-mobile',
  94. 'lottie-web': 'lottie'
  95. },
  96. theme: {
  97. "brand-primary": "#ff4d5cff",
  98. "color-text-base": "#333",
  99. "brand-primary-tap": "rgba(255, 77, 92, 0.8)"
  100. },
  101. }