.umirc.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { defineConfig } from 'umi';
  2. import px2rem from 'postcss-plugin-px2rem';
  3. import routes from './config/routes';
  4. export default defineConfig({
  5. nodeModulesTransform: {
  6. type: 'none',
  7. },
  8. routes,
  9. fastRefresh: {},
  10. extraBabelPlugins: [['import', { libraryName: 'antd-mobile', libraryDirectory: 'es/components', style: false }]],
  11. extraPostCSSPlugins: [
  12. //https://www.npmjs.com/package/postcss-plugin-px2rem
  13. px2rem({
  14. rootValue: 75, //把根标签的字体规定为1rem为75px,这样就可以从设计稿上量出多少个px直接在代码中写多上px了,设计稿尺寸以750px为标准
  15. unitPrecision: 5,
  16. propBlackList: [], //这些属性不需要转换
  17. selectorBlackList: ['t_npx'], //以包含t_npx的class不需要转换
  18. exclude: /(node_module)/,
  19. minPixelValue: 1,
  20. mediaQuery: true,
  21. }),
  22. ],
  23. proxy: {
  24. '/api-app': {
  25. // target: 'http://api.timichat.net',
  26. target: 'http://localhost:9201',
  27. changeOrigin: true,
  28. //pathRewrite: { '^/server': '' },
  29. },
  30. },
  31. hash: true,
  32. outputPath: './inappv2',
  33. history: { type: 'browser' },
  34. // webpack5: {},
  35. // mfsu: {},//暂时版本不稳定,未知BUG较多
  36. });