gulp - GulpUglifyError:Unable to minify JavaScript -
i trying minify script files using gulp task runner , trying gulp-uglify plugin
code:
gulp.task('concat', function() { return gulp.src('app/**/*.js') // .pipe(concat('script.js')) .pipe(uglify()) .pipe(gulp.dest('./dist/')) });
but getting error as
when try run gulp task gulp concat appreciated
to see error in console:
var gutil = require('gulp-util'); gulp.task('concat', function() { return gulp.src('app/**/*.js') // .pipe(concat('script.js')) .pipe(uglify()) .on('error', function (err) { gutil.log(gutil.colors.red('[error]'), err.tostring()); }) .pipe(gulp.dest('./dist/')) });
to find exact file line no of error register , run task:
var pump = require('pump'); gulp.task('uglify-error-debugging', function (cb) { pump([ gulp.src('app/**/*.js), uglify(), gulp.dest('./dist/') ], cb); });
Comments
Post a Comment