mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 02:35:14 +00:00
40 lines
942 B
TypeScript
40 lines
942 B
TypeScript
import dotenv from 'dotenv';
|
|
import { resolve } from 'path';
|
|
import { defineConfig } from 'umi';
|
|
import { getUmiConfig } from '../utils/src/umiConfig';
|
|
|
|
dotenv.config({
|
|
path: resolve(__dirname, '../../.env'),
|
|
});
|
|
|
|
process.env.MFSU_AD = 'none';
|
|
|
|
const umiConfig = getUmiConfig();
|
|
|
|
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) {
|
|
config.module.rules
|
|
.get('ts-in-node_modules')
|
|
.include.add(resolve(__dirname, '../client/src'));
|
|
config.resolve.alias.set(
|
|
'@nocobase/client',
|
|
resolve(__dirname, '../client/src'),
|
|
);
|
|
},
|
|
});
|