import { defineConfig } from 'umi'; import px2rem from 'postcss-plugin-px2rem'; import routes from './config/routes'; export default defineConfig({ nodeModulesTransform: { type: 'none', }, routes, fastRefresh: {}, extraBabelPlugins: [['import', { libraryName: 'antd-mobile', libraryDirectory: 'es/components', style: false }]], extraPostCSSPlugins: [ //https://www.npmjs.com/package/postcss-plugin-px2rem px2rem({ rootValue: 75, //把根标签的字体规定为1rem为75px,这样就可以从设计稿上量出多少个px直接在代码中写多上px了,设计稿尺寸以750px为标准 unitPrecision: 5, propBlackList: [], //这些属性不需要转换 selectorBlackList: ['t_npx'], //以包含t_npx的class不需要转换 exclude: /(node_module)/, minPixelValue: 1, mediaQuery: true, }), ], proxy: { '/api-app': { // target: 'http://api.timichat.net', target: 'http://localhost:9201', changeOrigin: true, //pathRewrite: { '^/server': '' }, }, }, hash: true, outputPath: './inappv2', history: { type: 'browser' }, // webpack5: {}, // mfsu: {},//暂时版本不稳定,未知BUG较多 });