Learning Grunt is a systematic guide that will help you build up your workflow from installing and using Grunt to a basic degree, to advanced configurations and creating your own plugins.
We'll start off by creating our development area and getting Node and Grunt installed. Then, we'll move on to look at some Grunt basics including defining and running tasks as well as working with configuration. Next we'll dive into getting the first iteration of our workflow setup, with a focus on running basic tasks. From there, we'll evolve our workflow into a more advanced build system focusing on tasks such as loading modules better using RequireJS, and testing our application using Karma and Jasmine. Lastly, you'll learn how to create your very own plugins in order to make your workflow unstoppable.
This course will give you the workflow you need to help you focus on building high-quality applications and sites instead of wrestling with manual processes.
About the Author
Dan has written and co-written nine books for Packt, mostly centered on jQuery and jQuery UI, and he regularly creates immersive video tutorials for various websites and companies.
See what you'll learn throughout the course.
Install the necessary software and create a folder for the examples to reside in.
Configure Grunt so that you can run tasks.
Learn how to create and run tasks, which are the fundamental building blocks of any Grunt workflow.
See how to provide a configuration for tasks, a key skill for using Grunt.
Understand the different ways of passing files to tasks, a very common requirement.
Consume data from the package json file inside the configuration.
Check your code automatically for syntax errors and potential bad practices.
Compile Sass files into CSS files ready for minification.
Preview your latest changes in an actual browser by running the site through a local web server.
Run unit tests from the command line for automation and speed.
Understand how well your unit tests cover your code with coverage reports.
Use a source control management system to store project files and maintain a history of the project. Git is one of the best.
New or changed files must be added to Git's index before they can be saved in the repository.
In order for Git to track changes to files or save new changes, they need to be committed to the repository.
Changes made to a feature branch need to be brought back to the master branch, ready to be released.
We can use the Grunt init plugin and the plugin template to quickly get started when creating a new plugin.
Our plugin will need to perform a specific task. We can overwrite the example code added by the template.
All plugins require configuration. We'll need to access this configuration inside our plugin.
We need to add unit tests to our plugin to ensure that it works the way that we expect.
Once we've created our plugin, we need to publish it on NPM so that we can install it just like other plugins that we've used in our workflow.
The Gruntfile can very quickly become extremely large and intimidating. It needs to be broken down into more manageable pieces.
We need to know how to troubleshoot problems that can occur when using Grunt.
There is much more to learn about Grunt. Find out where additional information can be found.
Packt has been committed to developer learning since 2004. A lot has changed in software since then - but Packt has remained responsive to these changes, continuing to look forward at the trends and tools defining the way we work and live. And how to put them to work.
With an extensive library of content - more than 4000 books and video courses -Packt's mission is to help developers stay relevant in a rapidly changing world. From new web frameworks and programming languages, to cutting edge data analytics, and DevOps, Packt takes software professionals in every field to what's important to them now.
From skills that will help you to develop and future proof your career to immediate solutions to every day tech challenges, Packt is a go-to resource to make you a better, smarter developer.
Packt Udemy courses continue this tradition, bringing you comprehensive yet concise video courses straight from the experts.