2021-12-03 07:31:22 +08:00
|
|
|
import path from 'path';
|
2020-11-11 15:23:39 +08:00
|
|
|
import { defineConfig } from 'umi';
|
2021-07-23 18:26:05 +08:00
|
|
|
import dotenv from 'dotenv';
|
2021-12-03 07:31:22 +08:00
|
|
|
import { getUmiConfig } from '@nocobase/utils';
|
2021-07-23 18:26:05 +08:00
|
|
|
|
|
|
|
dotenv.config({
|
|
|
|
path: path.resolve(__dirname, '../../.env'),
|
|
|
|
});
|
2020-11-11 15:23:39 +08:00
|
|
|
|
2021-12-03 07:31:22 +08:00
|
|
|
process.env.MFSU_AD = 'none';
|
|
|
|
|
|
|
|
const umiConfig = getUmiConfig();
|
|
|
|
|
2020-11-11 15:23:39 +08:00
|
|
|
export default defineConfig({
|
|
|
|
nodeModulesTransform: {
|
|
|
|
type: 'none',
|
|
|
|
},
|
2021-07-23 18:26:05 +08:00
|
|
|
define: {
|
2021-12-03 07:31:22 +08:00
|
|
|
...umiConfig.define,
|
2021-07-23 18:26:05 +08:00
|
|
|
},
|
2021-12-03 07:31:22 +08:00
|
|
|
// only proxy when using `umi dev`
|
|
|
|
// if the assets are built, will not proxy
|
2021-09-30 15:16:41 +08:00
|
|
|
proxy: {
|
2021-12-03 07:31:22 +08:00
|
|
|
...umiConfig.proxy,
|
2021-09-30 15:16:41 +08:00
|
|
|
},
|
2020-11-11 15:23:39 +08:00
|
|
|
routes: [
|
2021-05-23 08:38:08 +08:00
|
|
|
{ path: '/', exact: false, component: '@/pages/index' },
|
2020-11-11 15:23:39 +08:00
|
|
|
],
|
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: '-',
|
|
|
|
},
|
2021-12-02 14:11:19 +08:00
|
|
|
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'));
|
|
|
|
},
|
2020-11-11 15:23:39 +08:00
|
|
|
});
|