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-06 17:29:20 +08:00
|
|
|
define: {
|
|
|
|
...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'),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|