O'Reilly logo

Grunt Cookbook by Jurie-Jan Botha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Compressing files

The compression of files is quite a common practice within our local system, and across the World Wide Web. The most prominent use for file compression is to reduce the size of data that will be transferred across a network.

For our own purposes, we may at some point want to automate the compression of a file or folder that we'd like to make available for download or prepare for a transfer. The contrib-compress (0.10.0) plugin provides us with this functionality, along with options to specify the archive type and algorithms used in the process.

Getting ready

In this example, we'll work with the basic project structure we created in the Installing Grunt on a project recipe in Chapter 1, Getting Started with Grunt. Be sure to refer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required