Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

umi 使用 packages 怎么配置子包 #12125

Closed
xu756 opened this issue Feb 18, 2024 · 1 comment
Closed

umi 使用 packages 怎么配置子包 #12125

xu756 opened this issue Feb 18, 2024 · 1 comment

Comments

@xu756
Copy link

xu756 commented Feb 18, 2024

项目含有多个子包。 packages/react packages/core. packages/web. web 是umi项目,我在web里面使用 上面两个包,怎么连接不上,提示需要安装,
image

vite 有alias 配置重定向,umi怎么配置

image

@fz6m
Copy link
Member

fz6m commented Feb 19, 2024

把这个包名添加到 mfsu.exclude 排除掉,就可以修改自动更新了:

// .umirc.ts

  mfsu: { exclude: ['@note/react'] }

不过如果你的源码是 ts 写的,你要同步编译出来 js 产物才能热更新,所以 monorepoRedirect 这个功能就是用来重定位到 ts 源码的,把这个功能打开之后就会自动添加 alias 到其他子包去了,更多说明详见文档:

  monorepoRedirect: {}

@fz6m fz6m closed this as completed Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants