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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access