Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to debug gulp-sourcemaps not doing anything?

I have a fairly standard use case for gulp-sourcemaps

https://github.com/floridoo/gulp-sourcemaps

  gulp.src( bundle.src)
           .pipe(sourcemaps.init())
           .pipe(concat(bundle.dst + '.' + opts.ext))
            .pipe(uglify())
            .pipe(sourcemaps.write())
            .pipe(gulp.dest('./public/built'));

This produces appropriately concatenated and uglyified files. However there are no source map additions to them. bundle.src is an array of file paths. Not sure how to debug this.

like image 210
kevzettler Avatar asked Sep 30 '14 00:09

kevzettler


2 Answers

You should look into gulp-util. It may give you some insight into what is actually happening.

var gutil = require('gulp-util')
...
.pipe(sourcemaps.init().on('error', gutil.log))
like image 92
Jason Lydon Avatar answered Nov 06 '22 00:11

Jason Lydon


I had to specify where to write, like so:

.pipe(sourcemaps.write('./').on('error', gutil.log))

This didn't work: (no .map files generated)

.pipe(sourcemaps.write().on('error', gutil.log)
like image 2
KajMagnus Avatar answered Nov 05 '22 23:11

KajMagnus