refactor(ivy): export ngcc import prefix into constant (#25406)

PR Close #25406
This commit is contained in:
George Kalpakas 2018-07-26 22:54:03 +03:00 committed by Matias Niemelä
parent cdd4c9be63
commit e77f0fd6e6
2 changed files with 11 additions and 1 deletions

View File

@ -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';

View File

@ -15,6 +15,7 @@ import * as ts from 'typescript';
import {Decorator} from '../../../ngtsc/host'; import {Decorator} from '../../../ngtsc/host';
import {ImportManager, translateStatement} from '../../../ngtsc/transform'; import {ImportManager, translateStatement} from '../../../ngtsc/transform';
import {AnalyzedClass, AnalyzedFile} from '../analyzer'; import {AnalyzedClass, AnalyzedFile} from '../analyzer';
import {IMPORT_PREFIX} from '../constants';
import {NgccReflectionHost} from '../host/ngcc_host'; import {NgccReflectionHost} from '../host/ngcc_host';
interface SourceMapInfo { interface SourceMapInfo {
@ -70,7 +71,7 @@ export abstract class Renderer {
* @param targetPath The absolute path where the rendered file will be written. * @param targetPath The absolute path where the rendered file will be written.
*/ */
renderFile(file: AnalyzedFile, targetPath: string): RenderResult { 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 input = this.extractSourceMap(file.sourceFile);
const outputText = new MagicString(input.source); const outputText = new MagicString(input.source);