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
|
|
|
});
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
nodeModulesTransform: {
|
|
|
|
type: 'none',
|
|
|
|
},
|
|
|
|
define: {
|
|
|
|
'process.env.API_URL': process.env.API_URL,
|
|
|
|
'process.env.API_PORT': process.env.API_PORT,
|
|
|
|
},
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
|
|
|
'target': `http://localhost:${process.env.API_PORT}/`,
|
|
|
|
'changeOrigin': true,
|
|
|
|
'pathRewrite': { '^/api': '/api' },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
routes: [
|
|
|
|
{ path: '/', exact: false, component: '@/pages/index' },
|
|
|
|
],
|
|
|
|
fastRefresh: {},
|
|
|
|
locale: {
|
|
|
|
default: 'zh-CN',
|
|
|
|
// antd: false,
|
|
|
|
// title: false,
|
|
|
|
baseNavigator: false,
|
|
|
|
baseSeparator: '-',
|
|
|
|
},
|
|
|
|
});
|