tachybase_todo/packages/app/.umirc.ts

42 lines
849 B
TypeScript
Raw Normal View History

import { defineConfig } from 'umi';
2021-03-30 17:01:13 +08: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);
export default defineConfig({
2020-12-19 15:48:56 +08:00
title: false,
nodeModulesTransform: {
type: 'none',
},
define: {
'process.env.API': `/api`,
2021-03-22 13:33:57 +08:00
// 'process.env.API': `http://localhost:${process.env.API_PORT}/api`,
},
proxy: {
'/api': {
2021-03-22 13:33:57 +08:00
'target': `http://localhost:${process.env.API_PORT}/`,
'changeOrigin': true,
'pathRewrite': { '^/api' : '/api' },
},
},
2020-12-11 12:34:50 +08:00
locale: {
default: 'zh-CN',
// antd: false,
// title: false,
baseNavigator: false,
baseSeparator: '-',
},
routes: [
{
exact: false,
path: '/:path(.*)',
component: '@/pages/index',
},
],
});