Skip to content

monorepo项目中,dev模式如何得知被关联的子项目首次dev编译完成? #731

Closed Answered by PeachScript
PopperLi asked this question in Q&A
Discussion options

You must be logged in to vote

需要三处改动:

  1. 在 bundle 以及 bundless watch 模式构建完成时,通过 applyPlugins 执行插件钩子:https://github.com/umijs/umi/blob/13dd25b2b8e65a26764f796bb8be5aafb039be60/packages/preset-umi/src/commands/dev/dev.ts#L382-L385
  2. 注册该插件钩子:
    'addImportsCheckup',
  3. 提供对应类型:https://github.com/umijs/umi/blob/c5c292ee842673e2d46893ba5e364f13377db98a/packages/preset-umi/src/types.ts#L204-L209

参数暂时应该只需要 isFirstCompile

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@PopperLi
Comment options

@PeachScript
Comment options

Answer selected by PopperLi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants