2021-10-07 07:19:42 +00:00
|
|
|
import { defineConfig } from 'umi';
|
|
|
|
import dotenv from 'dotenv';
|
|
|
|
import path from 'path';
|
|
|
|
|
|
|
|
dotenv.config({
|
2021-10-07 09:24:31 +00:00
|
|
|
path: path.resolve(__dirname, './.env'),
|
2021-10-07 07:19:42 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
nodeModulesTransform: {
|
|
|
|
type: 'none',
|
|
|
|
},
|
|
|
|
define: {
|
2021-10-18 04:49:37 +00:00
|
|
|
'process.env.API_URL': process.env.API_URL || "http://127.0.0.1",
|
|
|
|
'process.env.API_PORT': process.env.API_PORT || "13001",
|
2021-10-07 07:19:42 +00:00
|
|
|
},
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
2021-10-18 04:49:37 +00:00
|
|
|
'target': `http://localhost:${process.env.API_PORT || "13001"}/`,
|
2021-10-07 07:19:42 +00:00
|
|
|
'changeOrigin': true,
|
|
|
|
'pathRewrite': { '^/api': '/api' },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
routes: [
|
|
|
|
{ path: '/', exact: false, component: '@/pages/index' },
|
|
|
|
],
|
|
|
|
fastRefresh: {},
|
|
|
|
locale: {
|
|
|
|
default: 'zh-CN',
|
|
|
|
// antd: false,
|
|
|
|
// title: false,
|
|
|
|
baseNavigator: false,
|
|
|
|
baseSeparator: '-',
|
|
|
|
},
|
|
|
|
});
|