.umirc.js 2.3 KB

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