How to use source maps with gulp?
...
sourcemaps = require('gulp-sourcemaps'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
...
gulp.task('concat-all-js', function() {
return gulp
.src([
'app/app.js',
'app/**/*.js'
])
.pipe(sourcemaps.init())
.pipe(concat('app.js'))
.pipe(uglify())
.pipe(rename({
suffix: '.min'
}))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist/'));
});
I add two files: app.min.js and app.min.js.map
But when I put the error in my app.min.js file, my source maps do not work.
I activated this option in my browser (Chrome), but I always see this error:
ReferenceError: blabla is not defined
at Object.formModel (http:
My files are the same / dist folder .
I see this line in my app.min.js (last line):
//
source
share