From e77f0fd6e68665837d314a571a4580668633a30d Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Thu, 26 Jul 2018 22:54:03 +0300 Subject: [PATCH] refactor(ivy): export ngcc import prefix into constant (#25406) PR Close #25406 --- packages/compiler-cli/src/ngcc/src/constants.ts | 9 +++++++++ packages/compiler-cli/src/ngcc/src/rendering/renderer.ts | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 packages/compiler-cli/src/ngcc/src/constants.ts diff --git a/packages/compiler-cli/src/ngcc/src/constants.ts b/packages/compiler-cli/src/ngcc/src/constants.ts new file mode 100644 index 0000000000..e73bb7df0f --- /dev/null +++ b/packages/compiler-cli/src/ngcc/src/constants.ts @@ -0,0 +1,9 @@ +/** + * @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 + */ + +export const IMPORT_PREFIX = 'ɵngcc'; diff --git a/packages/compiler-cli/src/ngcc/src/rendering/renderer.ts b/packages/compiler-cli/src/ngcc/src/rendering/renderer.ts index deb60e58bb..4a53d4b20c 100644 --- a/packages/compiler-cli/src/ngcc/src/rendering/renderer.ts +++ b/packages/compiler-cli/src/ngcc/src/rendering/renderer.ts @@ -15,6 +15,7 @@ import * as ts from 'typescript'; import {Decorator} from '../../../ngtsc/host'; import {ImportManager, translateStatement} from '../../../ngtsc/transform'; import {AnalyzedClass, AnalyzedFile} from '../analyzer'; +import {IMPORT_PREFIX} from '../constants'; import {NgccReflectionHost} from '../host/ngcc_host'; interface SourceMapInfo { @@ -70,7 +71,7 @@ export abstract class Renderer { * @param targetPath The absolute path where the rendered file will be written. */ renderFile(file: AnalyzedFile, targetPath: string): RenderResult { - const importManager = new ImportManager(false, 'ɵngcc'); + const importManager = new ImportManager(false, IMPORT_PREFIX); const input = this.extractSourceMap(file.sourceFile); const outputText = new MagicString(input.source);