GulpUglifyError:Unable to minify JavaScript

前端 未结 8 1839
感情败类
感情败类 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:27

    The main error is generated when you're using ES6 format. Use the gulp-uglify-es module instead of 'gulp-uglify' to overcome this error.

    var uglify = require('gulp-uglify-es').default;
    

    Note: gulp-uglify-es is no longer being maintained. You may want to use terser/gulp-terser instead:

提交回复
热议问题