gulp-uglify npm package of node.js


Overview

This plugin is used to remove the newlines and comments from the CSS/JS files or in other words it is used to minify the files.

Code


													
var gulp = require('gulp');
var uglify = require('gulp-uglify');
gulp.task('ugly' , function() {
	gulp.src('source/*.js')
	.pipe(uglify())
	.pipe(gulp.dest('destination'));
});
				
													
												

Run

  • Now run the snippet using the following command :
    													
    $ gulp	ugly