Reputation: 15
I'm using gulp uglify, and I'm getting an error.
this is my code:
var uglify = require('gulp-uglify');
var deleteLines = require('gulp-delete-lines');
// JS concat, strip debugging and minify
gulp.task('scripts', function() {
gulp.src(['./layout3/**/*.js','!./layout3/**/*.min.js'])
.pipe(deleteLines({
'filters': [/<script\s+type=["']text\/javascript["']\s+src=/i, /<script>/i]
}))
.pipe(uglify().on('error', function(e){
console.log(e);
}))
.pipe(gulp.dest('./layout2'));
});
I add print screen of the error:
I know that there is a problem in jquery.elevatezoom file, I can't find the problem.
thanks.
Upvotes: 0
Views: 650
Reputation: 189
i got this error after update the 'gulp-uglify', in my case is the pipe was replaced by pump.
because the pump can show error detail, checkt this why use pump
so, maybe you can try this:
var pump = require('pump'); //npm install it first
gulp.task('cssmin', function (cb) {
pump([
gulp.src(['./layout3/**/*.js','!./layout3/**/*.min.js']),
deleteLines({'filters': [/<script\s+type=["']text\/javascript["']\s+src=/i, /<script>/i]}),
uglify().on('error', function(e){
console.log(e);
})
gulp.dest('./layout2')
],
cb
);});
it works on my project now, hope it can help.
Upvotes: 2