How to debug gulp -sourcemaps do nothing?

I have a pretty 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 creates the corresponding concatenated and guessed files. However, there are no source maps for them. bundle.src- an array of file paths. Not sure how to debug this.

+4
source share
2 answers

You should see gulp-util . This may give you some idea of ​​what is actually happening.

var gutil = require('gulp-util')
...
.pipe(sourcemaps.init().on('error', gutil.log))
+1
source

I needed to specify where to write, for example:

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

This did not work: (no files .map)

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

All Articles