diff --git a/aio/content/guide/angular-compiler-options.md b/aio/content/guide/angular-compiler-options.md index e3fcdd53dd..76b79b939c 100644 --- a/aio/content/guide/angular-compiler-options.md +++ b/aio/content/guide/angular-compiler-options.md @@ -67,6 +67,15 @@ Modifies how Angular-specific annotations are emitted to improve tree-shaking. N 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`. +### `compilationMode` + +Specifies the compilation mode to use. The following modes are available: + +- `'full'`: generates fully AOT-compiled code according to the version of Angular that is currently being used. +- `'partial'`: generates code in a stable, but intermediate form suitable for a published library. + +The default value is `'full'`. + ### `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. diff --git a/goldens/public-api/compiler-cli/compiler_options.d.ts b/goldens/public-api/compiler-cli/compiler_options.d.ts index 2c462d513a..e972a3e99c 100644 --- a/goldens/public-api/compiler-cli/compiler_options.d.ts +++ b/goldens/public-api/compiler-cli/compiler_options.d.ts @@ -43,3 +43,7 @@ export interface StrictTemplateOptions { strictSafeNavigationTypes?: boolean; strictTemplates?: boolean; } + +export interface TargetOptions { + compilationMode?: 'full' | 'partial'; +} diff --git a/packages/compiler-cli/src/ngtsc/core/api/src/options.ts b/packages/compiler-cli/src/ngtsc/core/api/src/options.ts index 661221d87a..b9117d5459 100644 --- a/packages/compiler-cli/src/ngtsc/core/api/src/options.ts +++ b/packages/compiler-cli/src/ngtsc/core/api/src/options.ts @@ -8,7 +8,7 @@ import * as ts from 'typescript'; -import {BazelAndG3Options, I18nOptions, LegacyNgcOptions, MiscOptions, NgcCompatibilityOptions, StrictTemplateOptions} from './public_options'; +import {BazelAndG3Options, I18nOptions, LegacyNgcOptions, MiscOptions, NgcCompatibilityOptions, StrictTemplateOptions, TargetOptions} from './public_options'; /** @@ -36,22 +36,6 @@ export interface TestOnlyOptions { tracePerformance?: string; } -/** - * Options that specify compilation target. - */ -export interface TargetOptions { - /** - * Specifies the compilation mode to use. The following modes are available: - * - 'full': generates fully AOT compiled code using Ivy instructions. - * - 'partial': generates code in a stable, but intermediate form suitable to be published to NPM. - * - * To become public once the linker is ready. - * - * @internal - */ - compilationMode?: 'full'|'partial'; -} - /** * A merged interface of all of the various Angular compiler options, as well as the standard * `ts.CompilerOptions`. diff --git a/packages/compiler-cli/src/ngtsc/core/api/src/public_options.ts b/packages/compiler-cli/src/ngtsc/core/api/src/public_options.ts index 115554b7d9..7af887196d 100644 --- a/packages/compiler-cli/src/ngtsc/core/api/src/public_options.ts +++ b/packages/compiler-cli/src/ngtsc/core/api/src/public_options.ts @@ -340,6 +340,22 @@ export interface I18nOptions { i18nNormalizeLineEndingsInICUs?: boolean; } +/** + * Options that specify compilation target. + * + * @publicApi + */ +export interface TargetOptions { + /** + * Specifies the compilation mode to use. The following modes are available: + * - 'full': generates fully AOT compiled code using Ivy instructions. + * - 'partial': generates code in a stable, but intermediate form suitable for publication to NPM. + * + * The default value is 'full'. + */ + compilationMode?: 'full'|'partial'; +} + /** * Miscellaneous options that don't fall into any other category *