【Umi/Ant Design Pro】调试node_modules

umi默认启用msfu提升加载速度,但会导致node_modules更改无效。在AntDesignPro项目中,可通过config.ts移除mfsu配置,等待重新编译后,可观察到node_modules的改动生效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

umi 默认情况下会使用msfu,进行预编译,提高加载速度,但是这样会导致在node_modules做的修改,无法通过热更新获得实时的改动。

如果使用Ant Design Pro框架,那么就需要在config.ts中把配置项
mfsu: {}
去掉。
等待再次编译,即可看到node_modules中的变化

PS C:\Users\xpeng\Desktop\aurora\xp-ai-admin-aurora-fe> npm install @umijs/plugin-md-enhance --save npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: @ant-design/pro[email protected] npm WARN Found: [email protected] npm WARN node_modules/@ant-design/pro-form/node_modules/rc-field-form npm WARN rc-field-form@"~1.38.2" from ant[email protected] npm WARN node_modules/@ant-design/pro-form/node_modules/antd npm WARN antd@"^4.20.0 " from @ant-design/pro[email protected] npm WARN node_modules/@ant-design/pro-form npm WARN npm WARN Could not resolve dependency: npm WARN peer rc-field-form@"^1.22.0" from @ant-design/pro[email protected] npm WARN node_modules/@ant-design/pro-form npm WARN @ant-design/pro-form@"1.74.7" from @ant-design/pro[email protected] npm WARN node_modules/@ant-design/pro-table npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @ant-design/pro[email protected] npm ERR! Found: ant[email protected] npm ERR! node_modules/antd npm ERR! antd@"4.24.99-rc1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer antd@"4.x" from @ant-design/pro[email protected] npm ERR! node_modules/@ant-design/pro-layout npm ERR! peer @ant-design/pro-layout@"^6.0.0" from @umijs/[email protected] npm ERR! node_modules/@umijs/plugin-layout npm ERR! @umijs/plugin-layout@"0.18.1" from @umijs/[email protected] npm ERR! node_modules/@umijs/preset-react npm ERR! dev @umijs/preset-react@"1.x" from the root project npm ERR! @ant-design/pro-layout@"6.32.8" from the root project npm ERR! npm ERR! Conflicting peer dependency: ant[email protected] npm ERR! node_modules/antd npm ERR! peer antd@"4.x" from @ant-design/pro[email protected] npm ERR! node_modules/@ant-design/pro-layout npm ERR! peer @ant-design/pro-layout@"^6.0.0" from @umijs/[email protected] npm ERR! node_modules/@umijs/plugin-layout npm ERR! @umijs/plugin-layout@"0.18.1" from @umijs/[email protected] npm ERR! node_modules/@umijs/preset-react npm ERR! dev @umijs/preset-react@"1.x" from the root project npm ERR! @ant-design/pro-layout@"6.32.8" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! C:\Users\xpeng\AppData\Local\npm-cache\_logs\2025-06-11T09_03_17_716Z-eresolve-report.txt npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! C:\Users\xpeng\AppData\Local\npm-cache\_logs\2025-06-11T09_03_17_716Z-eresolve-report.txt npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! Fix the upstream dependency conflict, or retry npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! Fix the upstream dependency conflict, or retry npm ERR! Fix the upstream dependency conflict, or retry npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps PS C:\Users\xpeng\Desktop\aurora\xp-ai-admin-aurora-fe> npm install react-markdown highlight.js @umijs/plugin-mdx --save npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: @ant-design/pro[email protected] npm WARN Found: [email protected] npm WARN node_modules/@ant-design/pro-form/node_modules/rc-field-form npm WARN rc-field-form@"~1.38.2" from ant[email protected] npm WARN node_modules/@ant-design/pro-form/node_modules/antd npm WARN antd@"^4.20.0 " from @ant-design/pro[email protected] npm WARN node_modules/@ant-design/pro-form npm WARN npm WARN Could not resolve dependency: npm WARN peer rc-field-form@"^1.22.0" from @ant-design/pro[email protected] npm WARN node_modules/@ant-design/pro-form npm WARN @ant-design/pro-form@"1.74.7" from @ant-design/pro[email protected] npm WARN node_modules/@ant-design/pro-table npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @ant-design/pro[email protected] npm ERR! Found: ant[email protected] npm ERR! node_modules/antd npm ERR! antd@"4.24.99-rc1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer antd@"4.x" from @ant-design/pro[email protected] npm ERR! node_modules/@ant-design/pro-layout npm ERR! peer @ant-design/pro-layout@"^6.0.0" from @umijs/[email protected] npm ERR! node_modules/@umijs/plugin-layout npm ERR! @umijs/plugin-layout@"0.18.1" from @umijs/[email protected] npm ERR! node_modules/@umijs/preset-react npm ERR! dev @umijs/preset-react@"1.x" from the root project npm ERR! @ant-design/pro-layout@"6.32.8" from the root project npm ERR! npm ERR! Conflicting peer dependency: ant[email protected] npm ERR! node_modules/antd npm ERR! peer antd@"4.x" from @ant-design/pro[email protected] npm ERR! node_modules/@ant-design/pro-layout npm ERR! peer @ant-design/pro-layout@"^6.0.0" from @umijs/[email protected] npm ERR! node_modules/@umijs/plugin-layout npm ERR! @umijs/plugin-layout@"0.18.1" from @umijs/[email protected] npm ERR! node_modules/@umijs/preset-react npm ERR! dev @umijs/preset-react@"1.x" from the root project npm ERR! @ant-design/pro-layout@"6.32.8" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! C:\Users\xpeng\AppData\Local\npm-cache\_logs\2025-06-11T09_09_48_235Z-eresolve-report.txt npm ERR! A complete log of this run can be found in: C:\Users\xpeng\AppData\Local\npm-cache\_logs\2025-06-11T09_09_48_235Z-debug-0.log
最新发布
06-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值