.umirc.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // ref: https://umijs.org/config/
  2. import pageRoutes from './config/router.config';
  3. import pxToViewPort from 'postcss-px-to-viewport';
  4. const extraPostCSSPlugins = [
  5. pxToViewPort({
  6. viewportWidth: 750,
  7. unitPrecision: 5,
  8. viewportUnit: 'vw',
  9. selectorBlackList: [],
  10. minPixelValue: 1,
  11. mediaQuery: false
  12. })
  13. ]
  14. export default {
  15. // extraPostCSSPlugins,
  16. treeShaking: true,
  17. routes: pageRoutes,
  18. plugins: [
  19. // ref: https://umijs.org/plugin/umi-plugin-react.html
  20. ['umi-plugin-react', {
  21. antd: false,
  22. dva: true,
  23. dynamicImport: false,
  24. title: 'shipping',
  25. dll: false,
  26. hd: true,
  27. routes: {
  28. exclude: [
  29. /models\//,
  30. /services\//,
  31. /model\.(t|j)sx?$/,
  32. /service\.(t|j)sx?$/,
  33. /components\//,
  34. ],
  35. },
  36. }],
  37. ],
  38. extraBabelPlugins: [
  39. ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
  40. ],
  41. proxy: {
  42. '/api-app': {
  43. target: 'http://xkapi.laylib.com',
  44. // target: 'https://api.mfxike.com',
  45. changeOrigin: true,
  46. //pathRewrite: { '^/service-manage': 'service-manage' },
  47. },
  48. '/api-common': {
  49. target: 'http://xkapi.laylib.com',
  50. // target: 'https://api.mfxike.com',
  51. changeOrigin: true,
  52. //pathRewrite: { '^/service-manage': 'service-manage' },
  53. },
  54. },
  55. outputPath: 'shipping-h5',
  56. hash: true,
  57. theme: {
  58. "brand-primary": '#FF3344',
  59. "color-text-base": "#333",
  60. "brand-primary-tap": "#d92136"
  61. },
  62. }