monorepo 场景下,如何配置 mfsu 使其支持引入同仓库下的其他 packages ? #11925
Unanswered
Lemonnnnnnnnnnn
asked this question in
Q&A
Replies: 1 comment
-
如果你希望某个包不走 mfsu 预构建,就在 mfsu: { exclude: ['@cat/components', /@cat\//] } |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
简单描述问题:
我想要在主应用 apps/web 下引用工作空间下的组件库 packages/components , 组件库中包含 antd 。 我使用 father 将 packages/components 打包到 dist 中,然后引入 dist 中的组件,当我引用该组件时, 页面报错:Uncaught TypeError: Cannot read properties of null (reading 'useContext') 。
做的尝试:
我将 web/.umirc.ts 的 mfsu 配置关闭后,页面不再报错。于是我尝试修改 mfsu 配置,添加 exclude ,希望组件库不走 mfsu 逻辑 , 但依旧报相同的错误:
示例仓库::
https://github.com/Lemonnnnnnnnnnn/workspace-demo/tree/master/examples/umi-turbo
Beta Was this translation helpful? Give feedback.
All reactions