繁体   English   中英

AOT编译在Angular 12

[英]AOT compilation in Angular 12

Angular 文档指出:

 *Ahead-of-Time (AOT), which compiles your application and libraries at build time. This is the 
 default since Angular 9.*

因此,如果我想使用 AOT 编译我的Angular 12 应用程序,我只需要键入ng build而不添加--prod并且不在angular.jsonpackage.json中添加特定配置?

这是我的 package.json 中的ng 构建命令:

...
"scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "prepare": "husky install"
  },
...

谢谢你的帮助

您不需要为生产构建显式包含--prod命令 - 假设您使用的是最新版本的 Angular,即我收集的 v12。

默认的 angular.json 文件包含一个关于生产构建的配置文件部分,您可以保持原样。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM