tachybase_todo/packages/app/.umirc.ts

40 lines
979 B
TypeScript
Raw Normal View History

import { defineConfig } from 'umi';
2021-07-23 18:26:05 +08:00
import dotenv from 'dotenv';
import path from 'path';
dotenv.config({
path: path.resolve(__dirname, '../../.env'),
});
export default defineConfig({
nodeModulesTransform: {
type: 'none',
},
2021-07-23 18:26:05 +08:00
define: {
'process.env.API_URL': process.env.API_URL,
2021-10-01 23:31:49 +08:00
'process.env.API_PORT': process.env.API_PORT,
2021-07-23 18:26:05 +08:00
},
2021-09-30 15:16:41 +08:00
proxy: {
'/api': {
'target': `http://localhost:${process.env.API_PORT}/`,
'changeOrigin': true,
2021-10-01 23:31:49 +08:00
'pathRewrite': { '^/api': '/api' },
2021-09-30 15:16:41 +08:00
},
},
routes: [
2021-05-23 08:38:08 +08:00
{ path: '/', exact: false, component: '@/pages/index' },
],
2021-05-23 08:38:08 +08:00
fastRefresh: {},
2021-08-17 00:15:53 +08:00
locale: {
default: 'zh-CN',
// antd: false,
// title: false,
baseNavigator: false,
baseSeparator: '-',
},
chainWebpack(config) {
config.module.rules.get('ts-in-node_modules').include.add(path.resolve(__dirname, '../client/src'));
config.resolve.alias.set('@nocobase/client', path.resolve(__dirname, '../client/src'));
},
});