0

In Angular 5 I'm having an error using: ng serve --aot

if I build with JIT (at-loader) then everything is working, but I need AOT.

Here you can see the discussion: https://github.com/angular/angular/issues/20639

Help me, please.

enter image description here

ranakrunal9
  • 13,320
  • 3
  • 42
  • 43

2 Answers2

1

For compiling / Livesync, you no need to use --aot flag.

To Build your project, use

ng build --prod --aot

if you use --aot while serving, it will build your whole project with ContantInvalidating. By doing only ng serve it will run with AOT functionality

Deepak swain
  • 3,380
  • 1
  • 30
  • 26
  • @ Deepak swain - in the latest angularCLI versions, you just need the command: "ng build --prod", without "--aot", as this is run by default when building for production. – Francesco Apr 20 '18 at 14:54
0

angular v5+ have default aot so you can easily build your app with using for production ng build --prod

Ketan Chaudhari
  • 556
  • 6
  • 15