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

查看:29
本文介绍了如何加快 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 内存
  • 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 仅用于调试,希望对您有帮助

source map is intended only for debugging, Hope it helps

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

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