2022-03-06 09:29:20 +00:00
|
|
|
import dotenv from 'dotenv';
|
2022-02-10 10:37:16 +00:00
|
|
|
import { resolve } from 'path';
|
|
|
|
import { defineConfig } from 'umi';
|
2022-03-06 09:29:20 +00:00
|
|
|
import { getUmiConfig } from '../utils/src/umiConfig';
|
|
|
|
|
|
|
|
dotenv.config({
|
|
|
|
path: resolve(__dirname, '../../.env'),
|
|
|
|
});
|
2022-02-10 10:37:16 +00:00
|
|
|
|
|
|
|
process.env.MFSU_AD = 'none';
|
|
|
|
|
2022-03-06 09:29:20 +00:00
|
|
|
const umiConfig = getUmiConfig();
|
|
|
|
|
2022-02-10 10:37:16 +00:00
|
|
|
export default defineConfig({
|
2022-03-21 13:37:35 +00:00
|
|
|
hash: true,
|
2022-03-06 09:29:20 +00:00
|
|
|
define: {
|
2022-03-19 11:28:53 +00:00
|
|
|
'process.env.NOCOBASE_ENV': process.env.NOCOBASE_ENV,
|
2022-03-06 09:29:20 +00:00
|
|
|
...umiConfig.define,
|
|
|
|
},
|
|
|
|
// only proxy when using `umi dev`
|
|
|
|
// if the assets are built, will not proxy
|
|
|
|
proxy: {
|
|
|
|
...umiConfig.proxy,
|
|
|
|
},
|
2022-02-10 10:37:16 +00: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'),
|
|
|
|
);
|
2022-04-07 00:39:22 +00:00
|
|
|
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 10:37:16 +00:00
|
|
|
},
|
|
|
|
});
|