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 images task


The third task will handle all of the image processing. This task will be a bit smaller than the first two as it will only use a single plugin. The goal for this task is to optimize our images by minifying them, which will help reduce our payload and improve load times for our users.

Installing Gulp plugins

To minify our images, we will only use one plugin: gulp-imagemin. Like each task before it, you will need to install this locally and save it to your development dependencies as follows:

npm install gulp-imagemin --save-dev

The following two screenshots show the installation of the imagemin plugin:

Note

When running these commands, make sure that you're in the root directory of your project. If you're following the naming conventions used throughout this book, then the folder should be named gulp-book. Additionally, you may need to precede this command with sudo if you are running into permission errors.

Including Gulp plugins

With the new plugin installed, we can now add it to...

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