tachybase_todo/packages/app/client/.umirc.ts
2022-04-17 17:14:50 +08:00

39 lines
1.1 KiB
TypeScript

import { getUmiConfig } from '@nocobase/utils/umiConfig';
import dotenv from 'dotenv';
import { resolve } from 'path';
import { defineConfig } from 'umi';
const umiConfig = getUmiConfig();
dotenv.config({
path: resolve(__dirname, '../../../.env'),
});
process.env.MFSU_AD = 'none';
export default defineConfig({
hash: true,
define: {
'process.env.NOCOBASE_ENV': process.env.NOCOBASE_ENV,
...umiConfig.define,
},
// only proxy when using `umi dev`
// if the assets are built, will not proxy
proxy: {
...umiConfig.proxy,
},
nodeModulesTransform: {
type: 'none',
},
routes: [{ path: '/', exact: false, component: '@/pages/index' }],
// fastRefresh: {},
chainWebpack(config) {
const clientSrc = resolve(__dirname, '../../core/client/src');
const utilsSrc = resolve(__dirname, '../../core/utils/src');
config.module.rules.get('ts-in-node_modules').include.add(clientSrc);
config.resolve.alias.set('@nocobase/client', clientSrc);
config.module.rules.get('ts-in-node_modules').include.add(utilsSrc);
config.resolve.alias.set('@nocobase/utils', utilsSrc);
},
});