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

[Bug] 开启 forkTSChecker 后,第一次热更新特别慢的问题 #10935

Closed
fz6m opened this issue Apr 10, 2023 · 1 comment
Closed

[Bug] 开启 forkTSChecker 后,第一次热更新特别慢的问题 #10935

fz6m opened this issue Apr 10, 2023 · 1 comment

Comments

@fz6m
Copy link
Contributor

fz6m commented Apr 10, 2023

What happens?

开启 forkTSChecker: {} 后,第一次热更新特别慢。

Mini Showcase Repository(REQUIRED)

max 模板项目

How To Reproduce

  1. pnpm create umi project 选择 max 模板
  2. 开启 forkTSChecker: {}
  3. pnpm i && pnpm dev
  4. 修改某一处代码查看热更新速度,很慢

Context

  • Umi Version: 4.0.64
  • Node Version: 18
  • Platform: macos

来源

#10909 (comment)

解法

很忙,目前没深入研究,但经尝试,手动配置忽略 node_modules 是不会有减速的问题的:

// .umirc.ts

  chainWebpack(config) {
    config.watchOptions({
      ignored: /node_modules/,
    });
  },

关于 watchOptions.ignored ,如果内置的话,可能影响 link 调试、monorepo 等情况,有待后续全面的调试后再下结论。

最后更新日期:2023-04-26

@hujinbo
Copy link

hujinbo commented Apr 11, 2023

根据你提供的配置,第一次热更新很慢的问题可以避开,谢谢。
在Umi 3没有这个问题,配置也是默认开启的。期待后续优化

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