gulp sourcemaps doesn't update correct after pipe uglify and then gulpRegexp
hagaytarab opened this issue · 1 comments
hagaytarab commented
hi
i have problem when i use pipe uglify and then gulpRegexp
the sourcemap doesnt update correct .
i check in chrome debugging tool and i cant put breakpoint in my js file. if i use only one of them uglify or gulpRegexp it's work ok
var gulp = require("gulp"),
concat = require("gulp-concat") ,
sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglify'),
replaceSourcemaps = require('gulp-replace-with-sourcemaps'),
gulpRegexp = require('gulp-regexp-sourcemaps');
gulp.task('default', function () {
gulp.src('js/*.js')
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(concat('all.js'))
//if i remove uglify or gulpRegexp it work fine
.pipe(uglify())
.pipe(gulpRegexp(/(".*?")/g, '$1' + '\n'))
.pipe(sourcemaps.write(''))
.pipe(gulp.dest('dist/'));
});
any idea?
thanks alot
terinjokes commented
I've never used gulp-regexp-sourcemaps
but it sounds like it's incompatible with the newer sourcemaps generated by this plugin. Browsers are really picky with sourcemaps, and anything being off in the mappings will result in behavior like you describe.
Best of luck!