Build-tools and Live Reload
I’d been happily using Grunt for a while, but increasing buzz around Gulp was impossible to ignore and I decided to give it a try. I was immediately sold on Gulp's speed and how quickly I was able to write basic tasks. Before Grunt, I used CodeKit.
Gulp is still a young project and definitely rough around the edges, but I still prefer it to Grunt. Wrapping my head around Node Streams took a little work, but that knowledge investment isn’t limited to this tool. There’s also some really good thinking going into Gulp 4, and many of Gulp's warts will be fixed when the new version is released.
I'm working towards moving our gulpfiles into a public repository, but for now here's a simple gulpfile for building an HTML template. In less than 1/10 of a second, it does the following:
- Compiles and injects CSS styles from SCSS source files.
- Copies the images folder to the build directory
- Creates a zip archive of all images, also in the build directory
- Starts a LiveReload server, injects a code snippet and watches files for changes