GulpUglifyError:Unable to minify JavaScript

前端 未结 8 1911
感情败类
感情败类 2021-01-31 02:06

I am trying to minify my script files for which i am using gulp task runner And I am trying gulp-uglify plugin

Code:

 gulp.task(\'concat\', function() {         


        
8条回答
  •  情深已故
    2021-01-31 02:19

    For me, it was a deprecated option "preserveComments" that generated the error (and completely crashed the script).

    Found the issue using:

    gulp.task('concat', function() {
    return gulp.src('app/**/*.js')
        .pipe(uglify())
        .on('error', function (err) { console.log( err ) })
        .pipe(gulp.dest('./dist/'))
    });
    

提交回复
热议问题