简体   繁体   English

Angular 5.构建AOT

[英]Angular 5. Build AOT

In Angular 5 I'm having an error using: ng serve --aot 在Angular 5中,我使用以下方法出错: ng serve --aot

if I build with JIT (at-loader) then everything is working, but I need AOT. 如果我使用JIT(加载程序)进行构建,则一切正常,但是我需要AOT。

Here you can see the discussion: https://github.com/angular/angular/issues/20639 在这里您可以看到讨论: https : //github.com/angular/angular/issues/20639

Help me, please. 请帮帮我。

在此处输入图片说明

For compiling / Livesync, you no need to use --aot flag. 对于编译/ Livesync,您无需使用--aot标志。

To Build your project, use 要构建您的项目,请使用

ng build --prod --aot

if you use --aot while serving, it will build your whole project with ContantInvalidating. 如果您在投放时使用--aot ,它将使用--aot构建整个项目。 By doing only ng serve it will run with AOT functionality 通过仅执行ng serve ,它将与AOT功能一起运行

angular v5 +具有默认的aot,因此您可以轻松地将其用于生产ng build --prod

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

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