.umirc.js 2.4 KB

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