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

Cleaning your build

If you ran the previous sample, you might have noticed that when you ran it without the source files, your minified scripts were updated, but your copied source files were not removed from the prod folder. It is best practice to clean up any build folders before you create a new build. This assures that your build works from scratch and that you do not have any cached files. There used to be a plugin for this, but there is a Node.js module that already does what we need. As I said earlier, Gulp plugins should work on input and produce some output. Deleting files and folders does not fit that description though, so this is not really a Gulp plugin task anyway. So, we are going to use the Node.js del module (https://www.npmjs.com/package/del ...

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