2021-10-07 15:19:42 +08:00
|
|
|
import { defineConfig } from 'umi';
|
|
|
|
import dotenv from 'dotenv';
|
|
|
|
import path from 'path';
|
|
|
|
|
|
|
|
dotenv.config({
|
2021-10-07 17:24:31 +08:00
|
|
|
path: path.resolve(__dirname, './.env'),
|
2021-10-07 15:19:42 +08:00
|
|
|
});
|
|
|
|
|
2021-10-31 09:44:52 +08:00
|
|
|
process.env.MFSU_AD = 'none';
|
|
|
|
|
2021-10-07 15:19:42 +08:00
|
|
|
export default defineConfig({
|
2021-10-21 11:25:40 +08:00
|
|
|
favicon: '/favicon.png',
|
2021-10-07 15:19:42 +08:00
|
|
|
nodeModulesTransform: {
|
|
|
|
type: 'none',
|
|
|
|
},
|
|
|
|
define: {
|
2021-11-01 17:25:29 +08:00
|
|
|
'process.env.API_URL': process.env.API_URL || `/api/`,
|
2021-10-21 11:25:40 +08:00
|
|
|
'process.env.API_PORT': process.env.API_PORT || '13001',
|
2021-10-07 15:19:42 +08:00
|
|
|
},
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
2021-10-21 11:25:40 +08:00
|
|
|
target: `http://localhost:${process.env.API_PORT || '13001'}/`,
|
|
|
|
changeOrigin: true,
|
|
|
|
pathRewrite: { '^/api': '/api' },
|
2021-10-07 15:19:42 +08:00
|
|
|
},
|
|
|
|
},
|
2021-10-21 11:25:40 +08:00
|
|
|
routes: [{ path: '/', exact: false, component: '@/pages/index' }],
|
2021-10-07 15:19:42 +08:00
|
|
|
fastRefresh: {},
|
|
|
|
locale: {
|
|
|
|
default: 'zh-CN',
|
|
|
|
// antd: false,
|
|
|
|
// title: false,
|
|
|
|
baseNavigator: false,
|
|
|
|
baseSeparator: '-',
|
|
|
|
},
|
|
|
|
});
|