2020-11-11 07:23:39 +00:00
|
|
|
import { defineConfig } from 'umi';
|
2021-03-30 09:01:13 +00:00
|
|
|
import dotenv from 'dotenv';
|
|
|
|
import path from 'path';
|
|
|
|
|
|
|
|
dotenv.config({
|
|
|
|
path: path.resolve(__dirname, '../../.env'),
|
|
|
|
});
|
|
|
|
|
|
|
|
console.log('process.env.API_PORT', process.env.API_PORT);
|
2020-11-11 07:23:39 +00:00
|
|
|
|
|
|
|
export default defineConfig({
|
2020-12-19 07:48:56 +00:00
|
|
|
title: false,
|
2020-11-11 07:23:39 +00:00
|
|
|
nodeModulesTransform: {
|
|
|
|
type: 'none',
|
|
|
|
},
|
|
|
|
define: {
|
|
|
|
'process.env.API': `/api`,
|
2021-03-22 05:33:57 +00:00
|
|
|
// 'process.env.API': `http://localhost:${process.env.API_PORT}/api`,
|
2020-11-11 07:23:39 +00:00
|
|
|
},
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
2021-03-22 05:33:57 +00:00
|
|
|
'target': `http://localhost:${process.env.API_PORT}/`,
|
2020-11-11 07:23:39 +00:00
|
|
|
'changeOrigin': true,
|
|
|
|
'pathRewrite': { '^/api' : '/api' },
|
|
|
|
},
|
|
|
|
},
|
2020-12-11 04:34:50 +00:00
|
|
|
locale: {
|
|
|
|
default: 'zh-CN',
|
|
|
|
// antd: false,
|
|
|
|
// title: false,
|
|
|
|
baseNavigator: false,
|
|
|
|
baseSeparator: '-',
|
|
|
|
},
|
2020-11-11 07:23:39 +00:00
|
|
|
routes: [
|
|
|
|
{
|
|
|
|
exact: false,
|
|
|
|
path: '/:path(.*)',
|
|
|
|
component: '@/pages/index',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|