Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
ivogabe committed Jun 29, 2015
1 parent 8f724fc commit 82b7ad2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion release/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var Filter = (function () {
};
Filter.prototype.match = function (fileName) {
var fileNameExtensionless = utils.splitExtension(fileName)[0];
var outputFile = this.project.output.files[fileNameExtensionless];
var outputFile = this.project.output.files[utils.normalizePath(fileNameExtensionless)];
if (!outputFile) {
console.log('gulp-typescript: Could not find file ' + fileName + '. Make sure you don\'t rename a file before you pass it to ts.filter()');
return false;
Expand Down
19 changes: 14 additions & 5 deletions release/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var Output = (function () {
*/
Output.prototype.addOrMergeFile = function (fileName, kind, content) {
var _this = this;
var file = this.files[fileName];
var file = this.files[utils.normalizePath(fileName)];
if (file) {
file.content[kind] = content;
if (file.content[OutputFileKind.JavaScript] !== undefined
Expand Down Expand Up @@ -72,6 +72,10 @@ var Output = (function () {
file.skipPush = !file.original.gulp;
file.sourceMapOrigins = [file.original];
}
// Fix the output filename in the source map, which must be relative
// to the source root or it won't work correctly in gulp-sourcemaps if
// there are more transformations down in the pipeline.
file.sourceMap.file = path.relative(file.sourceMap.sourceRoot, originalFileName).replace(/\.ts$/, '.js');
}
this.applySourceMaps(file);
if (!this.project.sortOutput) {
Expand All @@ -80,7 +84,7 @@ var Output = (function () {
}
return;
}
this.files[fileName] = {
this.files[utils.normalizePath(fileName)] = {
fileName: fileName,
original: undefined,
sourceMapOrigins: undefined,
Expand Down Expand Up @@ -111,8 +115,13 @@ var Output = (function () {
continue;
var inputOriginalMap = sourceFile.gulp.sourceMap;
var inputMap = typeof inputOriginalMap === 'object' ? inputOriginalMap : JSON.parse(inputOriginalMap);
var consumer = new sourceMap.SourceMapConsumer(inputMap);
generator.applySourceMap(consumer);
/* We should only apply the input mappings if the input mapping isn't empty,
* since `generator.applySourceMap` has a really bad performance on big inputs.
*/
if (inputMap.mappings !== '') {
var consumer = new sourceMap.SourceMapConsumer(inputMap);
generator.applySourceMap(consumer);
}
if (!inputMap.sources || !inputMap.sourcesContent)
continue;
for (var i in inputMap.sources) {
Expand Down Expand Up @@ -164,7 +173,7 @@ var Output = (function () {
var _this = this;
if (this.project.sortOutput) {
var sortedEmit = function (fileName) {
var file = _this.files[fileName];
var file = _this.files[utils.normalizePath(fileName)];
if (!file || file.skipPush || file.pushed)
return;
var references = file.original.ts.referencedFiles.map(function (file) { return tsApi.getFileName(file); });
Expand Down

0 comments on commit 82b7ad2

Please sign in to comment.