Where to find AOT flag in Angular 6?

1.3k Views Asked by At

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?

2

There are 2 best solutions below

0
On BEST ANSWER

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
            }
          }
        }
      }
    }
  }
}
0
On

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.