Sourcemaps are generated properly even if intermediate plugins are used.
Actual behavior:
When I use gulp-header plugin in the gulp pipe, sourcemaps are generated but it is not possible to put breakpoints in the right place in the source code while debugging in Chrome Dev Tools. When I disable gulp-header plugin sourcemaps are generated correctly. As stated in gulp-header plugin documentation it supports sourcemaps, I've also made tests and it looks like it works fine. Moreover, I've tried to use other similar plugins to gulp-header, which support sourcemaps and the issue persists.
gulpfile:
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var header = require('gulp-header');
var ts = require('gulp-typescript');
var tsProject = ts.createProject('tsconfig.json');
gulp.task('default', function () {
return tsProject.src()
.pipe(sourcemaps.init())
.pipe(header('//Hello <%= name %>\n\n', { name: 'frenchu' }))
.pipe(tsProject())
.pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: '..' }))
.pipe(gulp.dest('dist'));
});
Expected behavior:
Sourcemaps are generated properly even if intermediate plugins are used.
Actual behavior:
When I use gulp-header plugin in the gulp pipe, sourcemaps are generated but it is not possible to put breakpoints in the right place in the source code while debugging in Chrome Dev Tools. When I disable gulp-header plugin sourcemaps are generated correctly. As stated in gulp-header plugin documentation it supports sourcemaps, I've also made tests and it looks like it works fine. Moreover, I've tried to use other similar plugins to gulp-header, which support sourcemaps and the issue persists.
gulpfile:
tsconfig.json:
Code:
Sample project where you can replicate the issue is here: github.com/frenchu/sourcemaps-issue
Remarks:
The reason of this issue may be similar to #576.