Open psi-4ward opened 9 years ago
This would be very nice!
I looked into the anatomy of sourcemaps, adding support for a appended string should not be complicated but altering the sourcemap for an prepended one results in a complex line-offset movearound.
I replaced gulp-insert with gulp-add
var s = gulp.src(sources, {base: 'modules'});
s = s.pipe(add('generated-header.js', header, true));
s = s.pipe(add('generated-footer.js', footer));
s = s.pipe(sourcemaps.init());
s = s.pipe(concat('app.js'));
so concat's sourcemap support handles the stuff for me
The module gulp-header supports source maps. But it can only do a prepend as the name may suggest.
Using gulp-insert with https://github.com/floridoo/gulp-sourcemaps shifts the lines:
gulp-task:
a JS file
Breaks on
var nextline
caused of the insert-wrap line