| 1. |
What Is A Task In Grunt? |
|
Answer» Tasks are grunt’s bread and butter. Every time Grunt is run, you specify one or more tasks to run, which tells Grunt what you’d like it to do. See below code.
Here, there are 2 tasks DEFINED concat and uglify. And for each task, we defined TARGETS. For concat, there are 2 targets “development” and “production” and only “development” for uglify. Creating target allows us to define separate settings for different objectives. Here, we can have different option for development and production version. It’s not COMPULSORY to define a target. Target’s can also have their own option parameters which will OVERRIDE the settings of options defined for the task. Tasks are grunt’s bread and butter. Every time Grunt is run, you specify one or more tasks to run, which tells Grunt what you’d like it to do. See below code. Here, there are 2 tasks defined concat and uglify. And for each task, we defined targets. For concat, there are 2 targets “development” and “production” and only “development” for uglify. Creating target allows us to define separate settings for different objectives. Here, we can have different option for development and production version. It’s not compulsory to define a target. Target’s can also have their own option parameters which will override the settings of options defined for the task. |
|