Book Image

Getting Started with Gulp ??? Second Edition - Second Edition

By : Travis Maynard
Book Image

Getting Started with Gulp ??? Second Edition - Second Edition

By: Travis Maynard

Overview of this book

This book is a hands-on guide to get you up to speed with gulp. You will quickly learn how to install, configure, and run your own build system. It will instill you with the ability to automate several common development tasks to vastly improve your development workflow. This book first demonstrates various Gulp use cases before running through the steps of configuring, running, and customizing Gulp, providing you with core concepts of gulp, node.js, and npm. Diving a bit deeper into the gulp ecosystem, we will discuss when and why to use a node module instead of a gulp plugin. We will also go over a few issues that we can run into while using gulp and learn about ways to work around them to improve your gulp experience. By the end of this book, you will be able to create your very own gulp build from scratch, create and maintain tasks and project builds, and automate your workflow with plugins and custom tasks.
Table of Contents (7 chapters)
Free Chapter
1
Introducing Gulp
2
Getting Started
3
Understanding the Basics of Gulp
4
Performing Tasks with Gulp
5
Creating Advanced Tasks
6
Tips, Tricks, and Resolving Issues

Creating Advanced Tasks

Until now, we have only explored basic implementations of Gulp plugins to handle the various tasks that we've built in our gulpfile. In this chapter, you are going to learn how to use plain Node.js modules in our Gulp tasks and explore new ways to create tasks using plugins and node modules together.

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...