GulpUglifyError:Unable to minify JavaScript

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

    Try using this

    var concat = require('gulp-concat');
    var uglify = require('gulp-uglify');
    var minifyJS = require('gulp-minify');
    
    gulp.task('concat', function() {
        return gulp.src('app/**/*.js')
            .pipe(minifyJS())
            .pipe(concat('bundle.min.js'))
            .pipe(uglify({ mangle: false }))
            .pipe(gulp.dest('./dist/'));
    });
    

提交回复
热议问题