Including modules/plugins
When writing a gulpfile
, you will always start by including the modules or plugins you are going to use in your tasks. These can be both gulp plugins and Node.js modules, based on what your needs are. Gulp plugins are small Node.js applications built for use inside of gulp to provide a single-purpose action, and can be chained together to create complex operations for your data. Node.js modules serve a broader purpose and can be used with gulp or independently.
Next, we can open our gulpfile.js
file and add the following code:
// Load Node Modules/Plugins var gulp = require('gulp'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify');
The gulpfile.js
file will look as shown in the following screenshot:

In this code, we have included gulp and two gulp plugins: gulp-concat
and gulp-uglify
. As you can now see, including a plugin into your gulpfile
is quite easy. After we install each module or plugin using npm, you simply use Node.js...