# Angular compiler options When you use [AOT compilation](guide/aot-compiler), you can control how your application is compiled by specifying *template* compiler options in the [TypeScript configuration file](guide/typescript-configuration). The template options object, `angularCompilerOptions`, is a sibling to the `compilerOptions` object that supplies standard options to the TypeScript compiler. ```json { "compilerOptions": { "experimentalDecorators": true, ... }, "angularCompilerOptions": { "fullTemplateTypeCheck": true, "preserveWhitespaces": true, ... } } ``` {@a tsconfig-extends} ## Configuration inheritance with extends Like the TypeScript compiler, The Angular AOT compiler also supports `extends` in the `angularCompilerOptions` section of the TypeScript configuration file. The `extends` property is at the top level, parallel to `compilerOptions` and `angularCompilerOptions`. A TypeScript configuration can inherit settings from another file using the `extends` property. The configuration options from the base file are loaded first, then overridden by those in the inheriting configuration file. For example: ```json { "extends": "../tsconfig.json", "compilerOptions": { "experimentalDecorators": true, ... }, "angularCompilerOptions": { "fullTemplateTypeCheck": true, "preserveWhitespaces": true, ... } } ``` For more information, see the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). ## Template options The following options are available for configuring the AOT template compiler. ### `allowEmptyCodegenFiles` When `true`, generate all possible files even if they are empty. Default is `false`. Used by the Bazel build rules to simplify how Bazel rules track file dependencies. Do not use this option outside of the Bazel rules. ### `annotationsAs` Modifies how Angular-specific annotations are emitted to improve tree-shaking. Non-Angular annotations are not affected. One of `static fields` (the default) or `decorators`. * By default, the compiler replaces decorators with a static field in the class, which allows advanced tree-shakers like [Closure compiler](https://github.com/google/closure-compiler) to remove unused classes. * The `decorators` value leaves the decorators in place, which makes compilation faster. TypeScript emits calls to the` __decorate` helper. Use `--emitDecoratorMetadata` for runtime reflection (but note that the resulting code will not properly tree-shake. ### `annotateForClosureCompiler` When `true`, use [Tsickle](https://github.com/angular/tsickle) to annotate the emitted JavaScript with [JSDoc](https://jsdoc.app/) comments needed by the [Closure Compiler](https://github.com/google/closure-compiler). Default is `false`. ### `disableExpressionLowering` When `true` (the default), transforms code that is or could be used in an annotation, to allow it to be imported from template factory modules. See [metadata rewriting](guide/aot-compiler#metadata-rewriting) for more information. When `false`, disables this rewriting, requiring the rewriting to be done manually. ### `disableTypeScriptVersionCheck` When `true`, the compiler does not check the TypeScript version and does not report an error when an unsupported version of TypeScript is used. Not recommended, as unsupported versions of TypeScript might have undefined behavior. Default is `false`. ### `enableI18nLegacyMessageIdFormat` Instructs the Angular template compiler to generate legacy ids for messages that are tagged in templates by the `i18n` attribute. See [Localizing your app](guide/i18n#mark-text-for-translations) for more information about marking messages for localization. Set this option to `false` unless your project relies upon translations that were previously generated using legacy ids. Default is `true`. The pre-Ivy message extraction tooling generated a variety of legacy formats for extracted message ids. These message formats have a number of issues, such as whitespace handling and reliance upon information inside the original HTML of a template. The new message format is more resilient to whitespace changes, is the same across all translation file formats, and can be generated directly from calls to `$localize`. This allows `$localize` messages in application code to use the same id as identical `i18n` messages in component templates. ### `enableIvy` Enables the [Ivy](guide/ivy) compilation and rendering pipeline. Default is `true`, as of version 9. In version 9, you can [opt out of Ivy](guide/ivy#opting-out-of-angular-ivy) to continue using the previous compiler, View Engine. For library projects generated with the CLI, the `prod` configuration default is `false` in version 9. ### `enableResourceInlining` When `true`, replaces the `templateUrl` and `styleUrls` property in all `@Component` decorators with inlined contents in `template` and `styles` properties. When enabled, the `.js` output of `ngc` does not include any lazy-loaded template or style URLs. For library projects generated with the CLI, the dev configuration default is `true`. {@a enablelegacytemplate} ### `enableLegacyTemplate` When `true`, enables use of the `