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
Introducing Gulp
Getting Started
Understanding the Basics of Gulp
Performing Tasks with Gulp
Creating Advanced Tasks
Tips, Tricks, and Resolving Issues

Tips, Tricks, and Resolving Issues

By this point, we have highlighted the many ways through which Gulp will improve your workflow and help you deliver more optimized and performant code. As with all software, there are some quirks that you may run into while using Gulp that could make the experience less than perfect.

In this chapter, we will explore some common tips, tricks, and solutions to some of the troubles that you may run into while using Gulp.

Handling errors

One of the biggest problems that I encountered when first learning Gulp was how to handle it when something failed. Unfortunately, gulp doesn't have a clean way to handle errors, and when failures do occur, it doesn't handle them very gracefully. For example, let's say we have our watch task running in the background as we are editing a Sass file. We're typing away and styling our website, but we accidentally hit a key that the...