2022-05-19 00:40:55 +08:00
|
|
|
import { getUmiConfig, resolveNocobasePackagesAlias } from '@nocobase/devtools/umiConfig';
|
2022-02-10 18:37:16 +08:00
|
|
|
import { defineConfig } from 'umi';
|
2022-04-17 17:14:50 +08:00
|
|
|
|
|
|
|
const umiConfig = getUmiConfig();
|
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: {
|
|
|
|
...umiConfig.define,
|
|
|
|
},
|
2022-09-18 14:10:01 +08:00
|
|
|
dynamicImportSyntax: {},
|
2022-03-06 17:29:20 +08:00
|
|
|
// 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: {},
|
2023-03-19 08:18:50 +08:00
|
|
|
chainWebpack(memo) {
|
|
|
|
resolveNocobasePackagesAlias(memo);
|
|
|
|
|
|
|
|
// 在引入 mermaid 之后,运行 yarn dev 的时候会报错,添加下面的代码可以解决。
|
2023-04-24 16:40:02 +08:00
|
|
|
memo.module
|
|
|
|
.rule('js-in-node_modules')
|
|
|
|
.test(/(react-error-boundary.*\.js|htmlparser2|(.*mermaid.*\.js$))/)
|
|
|
|
.include.clear();
|
2023-03-19 08:18:50 +08:00
|
|
|
return memo;
|
2022-02-10 18:37:16 +08:00
|
|
|
},
|
|
|
|
});
|