Running Custom Tasks With Grunt
Explore how to create and run custom tasks with Grunt by writing JavaScript functions in the Gruntfile.js. Understand how to configure package.json, register tasks, and automate complex workflows. This lesson helps you chain multiple tasks like minifying files and running custom commands sequentially using Grunt.
We'll cover the following...
We'll cover the following...
You need a package.json and Gruntfile.js to run tasks with Grunt.
The package.json
This file has a list of all the required dependencies, including Grunt.
The Gruntfile
The Gruntfile is where you’ll write some actual code to run tasks. It can:
- Configure tasks.
- Load plugins. Plugins are used to run ‘prebuilt’ Grunt tasks. Check out our plugins lesson to learn more about these.
- Register which tasks need to be run.