Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Getting Started with Gulp ??? Second Edition

You're reading from   Getting Started with Gulp ??? Second Edition Automating web development workflows

Arrow left icon
Product type Paperback
Published in Apr 2017
Publisher Packt
ISBN-13 9781787283732
Length 132 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Maynard Maynard
Author Profile Icon Maynard
Maynard
Arrow right icon
View More author details
Toc

The scripts task


The second task will be to handle all of the JavaScript files in the project. The goal with this task is to concatenate the code into a single file, minify that code into a smaller file size, and check the code for any errors that may prevent it from running properly.

Installing Gulp plugins

For this task, we will use three plugins: gulp-concat, gulp-uglify, and gulp -jshint, to accomplish our goals. Like before, we will install these tasks using the shorthand syntax to save time. Since we previously installed gulp and gulp-concat while we were writing the styles task, it is unnecessary to install them again.

Instead, we will only install any new plugins and ensure they are saved to our list of development dependencies, like so:

npm install --save-dev gulp-uglify gulp-jshint jshint

Note

You may have noticed that we're installing the jshint module alongside the gulp-jshint plugin. While we wont, be directly referencing this inside of our gulpfile, it is important to note that it...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images