Monday, June 7, 2021

Task Runner

 Build Tools or task runners are used to Automate the web development process for us. It reduces a developer’s effort in doing repetitive tasks or works  such as minification, compilation, unit testing, etc .

The main task runners used in javascript are Grunt and Gulp .

  • Grunt :


The Grunt system is huge and growing day by day. It holds  hundreds of plugins to choose from, we can use Grunt to automate  anything with a minimum of effort.

You have to put all your options into a wrapper function in Grunt file.js . The Grunt file contains configurations .You pass the tasks to automate in the configuration object and load all the required  plugins and register tasks. With this, you are ready to  run “grunt” on the terminal, the watch task will be fired and starts running automatically …

  • Gulp:


The features of Gulp are easy to use ,efficient, fast,and easy to learn

The configuration are in (gulpfile.js), it then compiles , minifies and uglifies the JS with a watch task when changes occurs .

Use “Gulp watch” to run the tasks .gulp  allows user  to write  build file in pure JavaScript .

Among the two Gulp seems to  be faster and the better performer in our experience.

No comments:

Followers

Link