Added AMD dependency reordering, so import order matches with provided names

This commit is contained in:
togru
2015-02-09 08:44:34 +01:00
parent 9974526101
commit 36990570c4
4 changed files with 41 additions and 1 deletions

View File

@@ -4718,7 +4718,13 @@ module ts {
var pathMatchResult = pathRegex.exec(comment);
var nameMatchResult = nameRegex.exec(comment);
if (pathMatchResult) {
amdDependencies.push({path: pathMatchResult[2], name: nameMatchResult ? nameMatchResult[2] : undefined });
var amdDependency = {path: pathMatchResult[2], name: nameMatchResult ? nameMatchResult[2] : undefined };
// AMD dependencies with names have to go first in define header
if (nameMatchResult) {
amdDependencies.push(amdDependency);
} else {
amdDependencies.unshift(amdDependency);
}
}
}
}