Grunt your way to automation

Setting up

With this post I hope to pass on some information about things I have learned about working with Grunt and a local environment. I personally use VVV because it ensures I’m working with the same environment when I switch between my Windows computer and MacBook. It also provides me more flexibility when it comes to configuring a server to test with.

Depending on the size of the project you want to take will help determine not only how many tasks but how many grunt plugins to use. Each one is documented decently with some example codes provided. There are some you will need to experiment with until you get it right but for the most part, they will do what you need them to do.

Once you get the hang of it you can progress to making your Gruntfile a little more streamlined and a little more modular for future projects.

If you haven’t already, install NodeJS and your local testing environment on your computer. Optionally you can install a version control system of your choice to keep track of changes if you want. Use what you are more comfortable with.

Grunt uses two files in order to run all of its tasks. The two files are package.json and Gruntfile.js both written in a JSON style. For the purposes of this article I’ll be using an extra bower.json file but only because it uses Susy in helping with SASS layouts.