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