Title Page
Getting Started with Gulp
Second Edition
Create powerful automations with Gulp to improve the efficiency of your web project workflow
Travis Maynard
BIRMINGHAM - MUMBAI
Copyright
Getting Started with Gulp
Second Edition
Copyright 2017 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2015
Second edition: April 2017
Production reference: 1260417
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78728-373-2
www.packtpub.com
Credits
Author Travis Maynard | Copy Editor Charlotte Carneiro |
Reviewer Sugan Gopalakrishnan | Project Coordinator Sheejal Shah |
Commissioning Editor Smeet Thakkar | Proofreader Safis Editing |
Acquisition Editor Denim Pinto | Indexer Rekha Nair |
Content Development Editor Jason Pereira | Graphics Jason Monteiro |
Technical Editor Rutuja Vaze | Production Coordinator Aparna Bhagat |
About the Author
Travis Maynard is a software engineer who focuses on minimalism and simplicity. He is currently creating software at JazzHR to help growing companies find and hire great employees. Prior to his work at JazzHR, he designed web frameworks and user experiences at West Virginia University to serve their education and marketing efforts.
In his spare time, he actively contributes to the open source software community and occasionally writes about the Web.
I would like to thank the gulp team for creating and supporting such a great tool. It has improved the lives of many developers and made our workflows far more efficient and enjoyable. More specifically, I would like to thank the team members, Eric Schoffstall and Blaine Bublitz, for their help with code reviews and mentoring me throughout my initial writings on gulp.
The team at Packt has been essential to the success of the book, and I really appreciate all the help that they have given me.
I would also like to thank my wife, Alaina, for supporting me throughout many late nights of writing. Her reviews and suggestions undoubtedly make this book far more enjoyable to read.
Last but most certainly not least, I would like to thank you, the reader, for choosing this book as your introductory guide to gulp. I hope that it serves you well, and what you learn will benefit you for many years to come.
About the Reviewer
Sugan Gopalakrishnan is an Associate Lead at Nagarro Pvt. Ltd, where he is a technical lead for multiple web applications. He has vast experience working on mobile and web applications while working for a wide range of companies, from start-ups to global brands. When he is not building software, he is either reading a book, or travelling, or doing both.
www.PacktPub.com
For support files and downloads related to your book, please visit www.PacktPub.com .
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com , you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.
Why subscribe?
- Fully searchable across every book published by Packt
- Copy and paste, print, and bookmark content
- On demand and accessible via a web browser
Customer Feedback
Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial process. To help us improve, please leave us an honest review on this book's Amazon page at https://www.amazon.com/dp/1787283739.
If you'd like to join our team of regular reviewers, you can e-mail us at customerreviews@packtpub.com. We award our regular reviewers with free eBooks
Table of Contents
Preface
I wrote this book to provide developers with a simple and inviting way to learn about Gulp and the tools that are required to use it. My goal is to keep the content simple and remain aware of the intimidation that I experienced while learning Gulp myself. With this in mind, I wanted to create content that wouldn't assume too much from beginners, while maintaining a steady pace to keep even experienced readers engaged.
What this book covers
, Introducing Gulp, focuses on helping you understand the languages and tools that you will use. You will learn how to use Gulp to perform automated tasks for your development workflow.
, Getting Started, deals with getting your local environment set up by installing any software that is needed to move forward. You will learn how to use a command-line interface and take a look at the anatomy of a gulpfile.
, Understanding the Basics of Gulp, explains the basics of Gulp and how its various methods interact with one another to create a gulpfile. You will learn how to use npm to install plugins and prepare yourself with the necessary knowledge to write your own tasks and gulpfile.
, Performing Tasks with Gulp, demonstrates how to create a set of base tasks for handling common workflow processes such as concatenating, minifying, and pre-processing your files.
, Creating Advanced Tasks, explores ways to improve our gulpfile by introducing new tasks and modifying our previous tasks to be more robust. This chapter also covers when and why to use Node.js modules instead of Gulp plugins. You will learn how to create various tasks that will run a static server, sync your project files with your browser(s), and implement Browserify and Babel to take advantage of the latest JavaScript features.