gulp.task('js', function(){
return browserify({
entries: ['./src/js/script.js']
})
.transform(babelify)
.bundle()
.pipe(source('script.min.js'))
.pipe(buffer()) // <----- convert from streaming to buffered vinyl file object
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(uglify())
.on('error', gutil.log)
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(dirs.build + '/js'));
});
Спасибо!