Search code examples
angularangular-cliangular-aot

Where to find AOT flag in Angular 6?


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?


Solution

  • 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
                }
              }
            }
          }
        }
      }
    }