O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Gulp API

Gulp has four methods that you will be using a lot. Those are src(), dest(), task(), and watch(). Additionally, you will be using Node's pipe() method to pass the output from one function to the other. The following example takes the css folder and simply copies it to a new css_copy folder:

var gulp = require('gulp');gulp.task('copycss', function () {   gulp.src('css*.css')      .pipe(gulp.dest('css_copy'));});gulp.task('default', ['copycss']);

As you can see, we defined two tasks, 'copycss' and 'default'. The 'default' task is started by Gulp by, well, default. In this case, the default task simply starts the tasks defined in the array, so copycss. In the copycss task, we take all the CSS files from the css folder. As you can see, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required