2022-04-17 17:14:50 +08:00
|
|
|
import { getUmiConfig } from '@nocobase/utils/umiConfig';
|
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-04-17 17:14:50 +08:00
|
|
|
|
|
|
|
const umiConfig = getUmiConfig();
|
2022-03-06 17:29:20 +08:00
|
|
|
|
|
|
|
dotenv.config({
|
2022-04-17 10:00:42 +08:00
|
|
|
path: resolve(__dirname, '../../../.env'),
|
2022-03-06 17:29:20 +08:00
|
|
|
});
|
2022-02-10 18:37:16 +08:00
|
|
|
|
|
|
|
process.env.MFSU_AD = 'none';
|
|
|
|
|
|
|
|
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) {
|
2022-04-17 10:00:42 +08:00
|
|
|
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);
|
2022-02-10 18:37:16 +08:00
|
|
|
},
|
|
|
|
});
|