nocobase/packages/create-nocobase-app/templates/AppGenerator/.umirc.ts

37 lines
824 B
TypeScript
Raw Normal View History

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-31 01:44:52 +00:00
process.env.MFSU_AD = 'none';
export default defineConfig({
2021-10-21 03:25:40 +00:00
favicon: '/favicon.png',
nodeModulesTransform: {
type: 'none',
},
define: {
'process.env.API_URL': process.env.API_URL || `/api/`,
2021-10-21 03:25:40 +00:00
'process.env.API_PORT': process.env.API_PORT || '13001',
},
proxy: {
'/api': {
2021-10-21 03:25:40 +00:00
target: `http://localhost:${process.env.API_PORT || '13001'}/`,
changeOrigin: true,
pathRewrite: { '^/api': '/api' },
},
},
2021-10-21 03:25:40 +00:00
routes: [{ path: '/', exact: false, component: '@/pages/index' }],
fastRefresh: {},
locale: {
default: 'zh-CN',
// antd: false,
// title: false,
baseNavigator: false,
baseSeparator: '-',
},
});