From the course: Gulp.js: Web Project Workflows

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Watching for changes

Watching for changes - Gulp.js Tutorial

From the course: Gulp.js: Web Project Workflows

Start my 1-month free trial

Watching for changes

- [Male Instructor] Another common task is a watcher, which looks for changes and files, and then fires up a new version of your browser. So we can do that in browser sync, but it's really typical to see it being done in gulp as well, so I'm going to show you how to do it. We'll need to add right here, something called watch. And then we'll need to create another task. We'll do it before the server. We're going to call this one watcher. Again, the callbacks are right there. And then we're going to go through and use that watch method. And here, what I want to do is pass along a series of globs that identify what I want to watch. So that's going to be the CSS folder, and actually, I'm going to make it a little simpler. I'm just going to say if anything changes in the origin, and this should be a slash right here, any subfolders, and anything else with an extension of .css, then I'm going to create or look for an event…

Contents