Using plain Node.js modules
Using Gulp plugins is the easiest way to add functionality to your workflow. However, the actions that you need to perform inside your tasks are sometimes better off being written using plain Node.js modules and occasionally you will need to use plugins and Node.js modules together.
In this section, we will cover common usage of plain Node.js modules, when and why these modules should be used in place of (or alongside of) Gulp plugins, and some various examples you can use in your own gulpfile to improve your builds.
Why use plain Node.js modules?
A common misunderstanding and topic of confusion for Gulp beginners is when and why to use plain Node.js modules in place of using or creating a new Gulp plugin. Generally, the best practice is that if you can use plain Node.js modules, then you should use plain Node.js modules.
Gulp was built on the Unix philosophy that we can pull together many smaller, single-purpose applications to perform more complex actions. With...