加快与打字稿项目建立在开发模式下的反应

发布于 2025-01-25 13:26:21 字数 280 浏览 5 评论 0原文

我有一个使用创建React App构建的TypeScript的React项目。 启动命令react-scripts start在任何文件更改时首次大约需要50秒钟,大约需要3秒钟。

每次更改代码后,如何特别加快构建时间?

我已经尝试过的一些事情

  1. 使用了craco,并在开发模式下介绍了eSbuild,而不是babel
  2. disabled eslint 但是这些并没有给我带来太大的速度。

我应该在哪个方向上进行调试?

I have a React project using Typescript built using create react app.
The start command react-scripts start takes around 50s on first time and around 3 seconds on any file change.

How can I speed up the build time specially after each change in code?

Some things I already tried

  1. Used craco and introduced esbuild instead of babel
  2. Disabled eslint in dev mode
    But these did not gave me much improvement in speed.

In which direction I should be debugging this more?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉世弥音 2025-02-01 13:26:21

我发现,如果我们弹出CRA并使用 vite 而不是webpack而不是webpack在构建时间上产生了很大的不同。您可以尝试。

I found that if we eject the CRA and use Vite instead of Webpack makes a lot of difference in the build time. You can try that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文