如何加快Angular的构建过程 [英] How to speed up the Angular build process

查看:92
本文介绍了如何加快Angular的构建过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的TypeScript文件中进行了一些更改之后,每个构建都需要20分钟以上. 我运行以下命令:ng build --output-path=..\..\static\angularjs.

After making some changes in my TypeScript files, each build takes over 20 minutes. I run this command: ng build --output-path=..\..\static\angularjs.

如果我在Microsoft PowerShell中运行它,则需要25到30秒.这是很多时间.

If I run it in Microsoft PowerShell, it needs 25 - 30 seconds. This is a lot of time.

环境

  • Windows 10
  • 8 GB-Ram
  • PyCharm 64
  • MS PowerShell

我该如何加快速度?

推荐答案

我的应用程序花费了28秒的构建时间,但我将时间减少到了9秒.使用此标志

My app took 28secs to build, but I've reduced the time to 9secs. Usings this flag

ng build --source-map=false

您可以看到比较时间的时间差异:

you can see the difference in time comparing the time:

ng build --stats-json 

ng build --stats-json --source-map=false

源映射仅用于调试,希望对您有帮助

source map is intended only for debugging, Hope it helps

这篇关于如何加快Angular的构建过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆