tachybase_todo/packages/app/.umirc.ts

47 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-03-06 17:29:20 +08:00
import dotenv from 'dotenv';
2022-02-10 18:37:16 +08:00
import { resolve } from 'path';
import { defineConfig } from 'umi';
2022-03-06 17:29:20 +08:00
import { getUmiConfig } from '../utils/src/umiConfig';
dotenv.config({
path: resolve(__dirname, '../../.env'),
});
2022-02-10 18:37:16 +08:00
process.env.MFSU_AD = 'none';
2022-03-06 17:29:20 +08:00
const umiConfig = getUmiConfig();
2022-02-10 18:37:16 +08:00
export default defineConfig({
2022-03-21 21:37:35 +08:00
hash: true,
2022-03-06 17:29:20 +08:00
define: {
2022-03-19 19:28:53 +08:00
'process.env.NOCOBASE_ENV': process.env.NOCOBASE_ENV,
2022-03-06 17:29:20 +08:00
...umiConfig.define,
},
// only proxy when using `umi dev`
// if the assets are built, will not proxy
proxy: {
...umiConfig.proxy,
},
2022-02-10 18:37:16 +08:00
nodeModulesTransform: {
type: 'none',
},
routes: [{ path: '/', exact: false, component: '@/pages/index' }],
// fastRefresh: {},
chainWebpack(config) {
config.module.rules
.get('ts-in-node_modules')
.include.add(resolve(__dirname, '../client/src'));
config.resolve.alias.set(
'@nocobase/client',
resolve(__dirname, '../client/src'),
);
config.module.rules
.get('ts-in-node_modules')
.include.add(resolve(__dirname, '../utils/src'));
config.resolve.alias.set(
'@nocobase/utils',
resolve(__dirname, '../utils/src'),
);
2022-02-10 18:37:16 +08:00
},
});