My Gulpfile was too damn big. To make a change, I had to scroll for miles, often passing the line I needed to edit or losing track of where I was.

To solve this, I started by searching Google for articles and examples written by people who have solved this before. I was most inspired by this simple gist.

I separated my tasks into modules — files containing no more than three tasks and their dependencies. Furthermore, I organized frequently used tasks into folders, and defined those tasks in my main gulpfile.js.

Let me break it down.