123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- 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.com/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.timichat.net',
- changeOrigin: true,
- },
- '/api-common': {
- target: 'http://api.timichat.net',
- 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: [],
- }
- });
|