.umirc.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // ref: https://umijs.org/config/
  2. import pxToViewPort from 'postcss-px-to-viewport';
  3. const extraPostCSSPlugins = [
  4. pxToViewPort({
  5. viewportWidth: 750,
  6. unitPrecision: 5,
  7. viewportUnit: 'vw',
  8. selectorBlackList: [],
  9. minPixelValue: 1,
  10. mediaQuery: false
  11. })
  12. ]
  13. export default {
  14. extraPostCSSPlugins,
  15. treeShaking: true,
  16. routes: [
  17. {
  18. path: '/',
  19. component: '../layouts/index',
  20. routes: [
  21. { path: '/', component: '../pages/Home' },
  22. ]
  23. }
  24. ],
  25. plugins: [
  26. // ref: https://umijs.org/plugin/umi-plugin-react.html
  27. ['umi-plugin-react', {
  28. antd: false,
  29. dva: false,
  30. dynamicImport: false,
  31. title: 'debri',
  32. dll: false,
  33. hd: true,
  34. routes: {
  35. exclude: [
  36. /components\//,
  37. ],
  38. },
  39. }],
  40. ],
  41. extraBabelPlugins: [
  42. ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
  43. ],
  44. proxy: {
  45. '/api-app': {
  46. target: 'http://api.timichat.net',
  47. changeOrigin: true,
  48. //pathRewrite: { '^/server': '' },
  49. },
  50. },
  51. hash: true,
  52. outputPath: '/debri'
  53. }