gulp-watch npm package of node.js


Overview

This is a plugin for gulp which is used to constantly look for changes in the given set of files.

Code


													
var gulp = require('gulp');
var concat = require('gulp-concat');
var watch = require('gulp-watch');

gulp.task('scripts' , function() {
	return gulp.src('source/*.js')			//add your custom source here
	.pipe(concat('min.js'))					// name of the output file
	.pipe(gulp.dest('destination4'));		// name of the destination folder comes here
});

gulp.task ( 'watch', function () {
    gulp.watch ('source/*.js' , [ 'scripts']);
});
        
													
												

Run

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