From cbb2425ccde8fc6b96fd5a5bdc297d96af8148f4 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 17 Aug 2015 10:37:44 -0700 Subject: [PATCH] addressed PR feedback --- src/compiler/emitter.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index bdd0ef60812..176b8694325 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -5344,6 +5344,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } + /* + * Some bundlers (SystemJS builder) sometimes want to rename dependencies. + * Here we check if alternative name was provided for a given moduleName and return it if possible. + */ function tryRenameExternalModule(moduleName: LiteralExpression): string { if (currentSourceFile.renamedDependencies && hasProperty(currentSourceFile.renamedDependencies, moduleName.text)) { return `"${currentSourceFile.renamedDependencies[moduleName.text]}"` @@ -6330,11 +6334,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi groupIndices[text] = dependencyGroups.length; dependencyGroups.push([externalImports[i]]); } - + if (i !== 0) { write(", "); - } - + } + write(text); } write(`], function(${exportFunctionForFile}) {`); @@ -6347,7 +6351,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi writeLine(); write("});"); } - + function emitAMDDependencies(node: SourceFile, includeNonAmdDependencies: boolean) { // An AMD define function has the following shape: // define(id?, dependencies?, factory);