Bill Gates once said, “I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.”
In the programming world there are a myriad of similar quotes, all suggesting that one should work smart, not hard. Putting this theory into practice as a front-end developer in today’s environment entails automating repetitive tasks and leaning on one’s machine to perform the hard work. As an example, let’s look at a typical user interacting with a website:
By utilizing a task runner during the development process, a developer is able to work in a well structured file system and leverage modern tools like Sass and Livereload, while still outputting the appropriate minified and compiled source files without any additional effort.
Our Task Kit
At Fresh Tilled Soil we recently polled our developers to see what tasks they relied on most on a daily basis. We then put together a base task runner that can be pulled into a new or existing project to automate those tasks for them.
The base tasks include:
- CSS autoprefixer
- Sass compiler
- CSS / JS minification
- JS concatenation
- Image minification
If you are up to date on current task runners, you will note that there are actually two extremely popular options: Grunt (http://gruntjs.com/) and Gulp (http://gulpjs.com/). Both work in a similar fashion, and we put together similar configurations for each:
- Gulp (https://github.com/freshtilledsoil/FTS-gulp)
- Grunt (https://github.com/freshtilledsoil/FTS-grunt)