import { defineConfig } from 'umi'; import pxToViewPort from 'postcss-px-to-viewport'; import routes from './config/routes'; export default defineConfig({ nodeModulesTransform: { type: 'none', }, routes, fastRefresh: {}, extraBabelPlugins: [ [ 'import', { libraryName: 'antd-mobile', libraryDirectory: 'es/components', style: false, }, ], ], extraPostCSSPlugins: [ pxToViewPort({ viewportWidth: 375, unitPrecision: 5, viewportUnit: 'vw', fontViewportUnit: 'vw', selectorBlackList: [], minPixelValue: 1, mediaQuery: true, }), ], proxy: { '/api-app': { //target: 'http://api.timichat.net', target: 'http://localhost:9201', changeOrigin: true, //pathRewrite: { '^/server': '' }, }, '/api-common': { //target: 'http://api.starbuds.laylib.com', target: 'http://localhost:9230', changeOrigin: true, //pathRewrite: { '^/server': '' }, }, }, hash: true, outputPath: './play-dist', history: { type: 'browser' }, // webpack5: {}, // mfsu: {},//暂时版本不稳定,未知BUG较多 });