.umirc.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { defineConfig } from 'umi';
  2. import pxToViewPort from 'postcss-px-to-viewport';
  3. import routes from './config/routes';
  4. export default defineConfig({
  5. nodeModulesTransform: {
  6. type: 'none',
  7. },
  8. routes,
  9. fastRefresh: {},
  10. extraBabelPlugins: [
  11. [
  12. 'import',
  13. {
  14. libraryName: 'antd-mobile',
  15. libraryDirectory: 'es/components',
  16. style: false,
  17. },
  18. ],
  19. ],
  20. extraPostCSSPlugins: [
  21. pxToViewPort({
  22. viewportWidth: 375,
  23. unitPrecision: 5,
  24. viewportUnit: 'vw',
  25. fontViewportUnit: 'vw',
  26. selectorBlackList: [],
  27. minPixelValue: 1,
  28. mediaQuery: true,
  29. }),
  30. ],
  31. proxy: {
  32. '/api-app': {
  33. //target: 'http://api.timichat.net',
  34. target: 'http://localhost:9201',
  35. changeOrigin: true,
  36. //pathRewrite: { '^/server': '' },
  37. },
  38. '/api-common': {
  39. //target: 'http://api.starbuds.laylib.com',
  40. target: 'http://localhost:9230',
  41. changeOrigin: true,
  42. //pathRewrite: { '^/server': '' },
  43. },
  44. },
  45. hash: true,
  46. outputPath: './play-dist',
  47. history: { type: 'browser' },
  48. // webpack5: {},
  49. // mfsu: {},//暂时版本不稳定,未知BUG较多
  50. });