import defaultSettings from './defaultSettings'; // https://umijs.org/config/ import { chainWebpack } from './plugin.config' import slash from 'slash2'; import themePluginConfig from './themePluginConfig'; // preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 import { routerConfig } from './routerConfig.js'; import { defineConfig } from 'umi'; const autoprefixer = require('autoprefixer') const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env; const isAntDesignProPreview = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site'; export default defineConfig({ antd: {}, dva: { hmr: true, }, locale: { default: 'zh-CN', antd: true, baseNavigator: true, }, headScripts: [ 'http://sp.qn.timichat.cn/assets/AgoraRTCSDK/3.0.2/AgoraRTCSDK-3.0.2.js' ], hash: true, targets: { ie: 9, }, routes: routerConfig, theme: { 'primary-color': '#ff4d5c', }, define: { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION || '', // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 }, ignoreMomentLocale: true, lessLoader: { javascriptEnabled: true, }, extraPostCSSPlugins: [ autoprefixer({ flexbox: true }) ], manifest: { basePath: '/', }, proxy: { '/api-manage': { target: 'http://api.dev.hidouyou.com', changeOrigin: true, }, '/api-common': { target: 'http://api.dev.hidouyou.com', changeOrigin: true, }, '/rongcloud': { target: 'http://message2.ronghub.com', changeOrigin: true, pathRewrite: { '^/rongcloud': '' }, } }, mock: { exclude: [], }, publicPath: '/', outputPath: '/manage', // mfsu: {}, //开启后热更新失效,当前版本慎用 webpack5: {}, fastRefresh: {}, dynamicImportSyntax: {}, esbuild: {}, //替换压缩器为 esbuild // devtool: false, nodeModulesTransform: { type: 'none', exclude: [], } });