Skip to content

Commit adebb92

Browse files
authored
Merge pull request #465 from techmatt101/master
fixed sourcemap sources being lost for files with existing mappings #460
2 parents 202b345 + a932aab commit adebb92

File tree

10 files changed

+63
-1
lines changed

10 files changed

+63
-1
lines changed

lib/output.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class Output {
8080
// since `generator.applySourceMap` has a really bad performance on big inputs.
8181
if (inputMap.mappings !== '') {
8282
const consumer = new sourceMap.SourceMapConsumer(inputMap);
83-
generator.applySourceMap(consumer, sourceFile.fileNameOriginal, sourceFile.gulp.base);
83+
generator.applySourceMap(consumer);
8484
}
8585

8686
if (!inputMap.sources || !inputMap.sourcesContent) continue;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
{
3+
"transpileErrors": 0,
4+
"optionsErrors": 0,
5+
"syntaxErrors": 0,
6+
"globalErrors": 0,
7+
"semanticErrors": 0,
8+
"declarationErrors": 0,
9+
"emitErrors": 0,
10+
"emitSkipped": false
11+
}

test/baselines/existingSourceMaps/2.0/js/all.js

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/baselines/existingSourceMaps/2.0/js/all.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
{
3+
"transpileErrors": 0,
4+
"optionsErrors": 0,
5+
"syntaxErrors": 0,
6+
"globalErrors": 0,
7+
"semanticErrors": 0,
8+
"declarationErrors": 0,
9+
"emitErrors": 0,
10+
"emitSkipped": false
11+
}

test/baselines/existingSourceMaps/dev/js/all.js

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/baselines/existingSourceMaps/dev/js/all.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/existingSourceMaps/apple.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class Apple {}

test/existingSourceMaps/banana.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class Banana {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var gulp = require('gulp');
2+
var concat = require('gulp-concat');
3+
var sourcemaps = require('gulp-sourcemaps');
4+
5+
module.exports = function(newTS, lib, output, reporter) {
6+
return gulp.src('test/existingSourceMaps/*.ts')
7+
.pipe(sourcemaps.init())
8+
.pipe(concat('all.ts'))
9+
.pipe(newTS({ typescript: lib }, reporter)).js
10+
.pipe(sourcemaps.write('.'))
11+
.pipe(gulp.dest(output + '/js'));
12+
};

0 commit comments

Comments
 (0)