Getting Started with Less

The Hard Way 1/2 (Task Runners)

Getting Setup (professional ways)

So, at this point you now know the very easy ways to get setup and the "medium" way via helper apps.

For the purpose of this course, we will be using the "medium" way in all demos and lessons.

However, even though those compile methods are totally acceptable, it's important to cover the professional way that developers are compiling their apps.

The "Professional Way" uses what are called Task Runners to compile the Less. Think of Task Runners as code you personally write and customize to do all the things that the is doing for you.

Task Runner Benefits

Total and Complete Control

You can customize your "build" or "compile" process to do anything you want. Want to minify your CSS but add a comment block to the top? Perfect, write a script for that. Want to timestamp the bottom of the files? Perfect, write a script for that.

The point is there's an infinite amount of tools online that people are using for their projects. An app like is really great for most cases, but as you move on to larger and more custom projects, you'll eventually need something to handle your all your individual and sometimes niche use-cases.

Easier to Collaborate (zero configuration)

The other benefit is task runners are directly integrated into your project. So, you could essentially share anyone your working with the project, give them instructions to "activate" the Task Runner, and they are essentially setup to begin development. There's no configuration in prepros or figuring out what your "build" process is.

Just clone the project and go!

Dev, Staging, and Production Build Processes

The other benefit of task runners are you can have multiple "build" processes. For example:

  • build for development
  • build for staging
  • build for production

Where "development" build process doesn't minify the files making it easier to debug while staging does. Then, finally, maybe the "production" build rewrites all image paths to your production apps CDN.

Task Runner Examples

Learning task runners and their benefits entirely is for a completely different course. However, I do want to intro you to some of them. The most popular ones in order are probably:

  1. Gulp
  2. Webpack (technically not a task runner but roughly same thing for the sake of what we're talking about)
  3. Grunt

Like this article? Follow @whatnicktweets on Twitter