0

1) Where in Angular.io website documentation i can find that AOT is already enabled by default in Angular 6?

2)I have my cli based application of Angular 6. In which file can i find this flag so i can enable or disable it?

billyjov
  • 2,778
  • 19
  • 35
knowdotnet
  • 839
  • 1
  • 15
  • 29

2 Answers2

3

For the command line, you can follow what @Sajeetharan stated in his answer. However, take note that all flags are to be used with 2 hyphens, not 1 hyphen as what Sajeetharan did:

ng build --prod --aot=false

For the Angular workspace file (aka angular.json), this can be found in the configurations object:

{
  "projects": {
    "my-project": {
      "architect": {
        "build": {
          "configurations": {
            "production": {
              "aot": true
            }
          }
        }
      }
    }
  }
}
Edric
  • 24,639
  • 13
  • 81
  • 91
2

AOT is one of the compilation method which compiles app in prod mode,

The flag --prod does the AOT compilation by default.you can disable it by setting -aot to be false

ng build -prod -aot=false. 

This will disable the aot compiler.

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396