Book Image

Mastering Grunt [Video]

By : Bertrand Chevrier
Book Image

Mastering Grunt [Video]

By: Bertrand Chevrier

Overview of this book

<p>Grunt is everywhere. From JavaScript projects in jQuery to Twitter Bootstrap, everyone's using Grunt to convert code, run tests, and produce distributions for production. Web development activities are marked by repetitive tasks such as optimization, compilation, sprites assembling, and testing. Grunt stands on a wide number of rock solid plugins that will do the job for you, helping you to maximize your development time by reducing time spent doing repetitive tasks.</p> <p>With this course, not only will you be able to set up and use Grunt in your projects, you’ll also learn about the Grunt internals and its philosophy. The goal is to prepare you to become a Grunt expert—from complex configuration to plugin authoring.</p> <p>Using a real application as a leading thread, called Foodprint.io, we will automate most of the repetitive tasks in its workflow such as compiling SASS files, running unit tests, and bundling ES2015 code to ES5. We will start with an advanced configuration and customization of the Grunt environment, focusing on practical examples of creating a customized Grunt environment that will support large-scale web development.</p> <p>Next, we will discover one of the most powerful aspects of Grunt—using live tasks to run the application in development mode. We'll talk about LiveReload, Test Automation, Modular configuration, and combining tasks. Another crucial part of the course is dedicated to creating a Grunt plugin from scratch, and we'll cover how to scaffold plugins using Grunt init and Yeoman, how to test them with Mocha and Chai, and how to publish them so others can use them. We finally end our journey with a dedicated focus on best practices and troubleshooting.</p> <p>Full of advice, best practices, and real-life examples, the course isn’t just a combination of different Grunt configurations, it will give you all you need to architect your automation workflow, debug existing ones, and implement Grunt successfully in large and complex applications.</p> <h1>Style and Approach</h1> <p>This video course is an advanced practical guide that will dive deep into efficiently creating and maintaining large scale tasks and project builds, automating work-flows of large groups by creating complex routines, integrating third-party plugins, and creating custom tasks. During the course, we will implement Grunt step-by-step, introducing a new concept in every section. The course leads you through concrete use cases, from an efficient Grunt configuration to the development of your own Grunt tasks all in less than 3 hours.</p>
Table of Contents (7 chapters)
Chapter 6
Managing a Maintainable Grunt Config
Content Locked
Section 3
Taking Advantage of Your Environment – Grunt with npm
Even if Grunt can run tasks for any kind of platform and language, it runs itself on Node.js and uses npm for dependency management. We will see how we can take advantage of that. - Use package.json as a configuration file and metadata - Use the npm scripts to run grunt tasks - Map grunt tasks into the npm life cyle