0

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:

enter image description here

I know that there is a problem in jquery.elevatezoom file, I can't find the problem.

thanks.

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.