Clean task
Generating and processing files is great, but there may come a time when you or your teammates need to simply clear out the files that you have processed and start anew.
To do so, we are going to create another task that will clean out any processed files from our dist
directory. To do this, we are going to use a node module called del
, which will allow us to target multiple files and use globs in our file paths.
Installing the del module
Install the del
module using npm and then save it to your list of development dependencies with the --save-dev
flag:
npm install del --save-dev
The following screenshot shows the installation of the del
module:

Including the del module
Once the module has been installed, you must add it to your list of required modules at the top of your gulpfile
:
// Load Node Modules/Plugins var gulp = require('gulp'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var jshint = require('gulp-jshint'); var imagemin ...