feat(compiler-cli): export tooling definitions (#29929)
PR Close #29929
This commit is contained in:
@ -17,6 +17,7 @@ export * from './src/transformers/api';
|
||||
export * from './src/transformers/entry_points';
|
||||
|
||||
export * from './src/perform_compile';
|
||||
export * from './src/tooling';
|
||||
|
||||
// TODO(tbosch): remove this once cli 1.5 is fully released,
|
||||
// and usages in G3 are changed to `CompilerOptions`.
|
||||
|
22
packages/compiler-cli/src/tooling.ts
Normal file
22
packages/compiler-cli/src/tooling.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Tooling support helpers.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Known values for global variables in `@angular/core` that Terser should set using
|
||||
* https://github.com/terser-js/terser#conditional-compilation
|
||||
*/
|
||||
export const GLOBAL_DEFS_FOR_TERSER = {
|
||||
ngDevMode: false,
|
||||
ngI18nClosureMode: false,
|
||||
};
|
@ -83,8 +83,7 @@ export function ngDevModeResetPerfCounters(): NgDevModePerfCounters {
|
||||
* set `ngDevMode == false` we should be helping the developer by providing
|
||||
* as much early warning and errors as possible.
|
||||
*
|
||||
* NOTE: changes to the `ngDevMode` name must be synced with the CLI and
|
||||
* possibly other third party tooling. Check with them before altering it.
|
||||
* NOTE: changes to the `ngDevMode` name must be synced with `compiler-cli/src/tooling.ts`.
|
||||
*/
|
||||
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
||||
ngDevModeResetPerfCounters();
|
||||
|
@ -13,8 +13,7 @@ declare global {
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: changes to the `ngI18nClosureMode` name must be synced with the CLI and
|
||||
* possibly other third party tooling. Check with them before altering it.
|
||||
* NOTE: changes to the `ngI18nClosureMode` name must be synced with `compiler-cli/src/tooling.ts`.
|
||||
*/
|
||||
if (typeof ngI18nClosureMode === 'undefined') {
|
||||
// Make sure to refer to ngI18nClosureMode as ['ngI18nClosureMode'] for closure.
|
||||
|
Reference in New Issue
Block a user