CLI Tools

Click Here for TL;DR

Using Bower Installer in Your Build Process

I am currently working on an enterprise application that, it goes without saying, is very large. I rely heavily on bower to install my dependencies that I use throughout the application. I would say that we are about 5% done with the application and already our bower.json file has 20 dependencies (not to mention the dependencies those dependencies download...).

Click Here for TL;DR

Understanding Bower

Modularity in code is great for a number of reasons:
  1. less work (someone else did it for you)
  2. tested for more use cases than you can think of on your own (might not seem important until your user base goes up)
  3. update easily
  4. reasons
Humans and computers are good at different tasks. So while you as a human will still need to hunt down _which_ module will work best, there are machine tools to do the well-defined, rote work of getting modules into your project. Enter bower.

Click Here for TL;DR

Gulp LESS Nightmare (due to operator error)

I recently wrote a post about GulpJS and all of it's awesomeness. Almost immediately following that post I spent several hours pulling my hair out because I couldn't figure out why my Gulp LESS task wasn't working. So I did the research and suffered through the misery so you don't have to ;) Let Me Set Up Our Environment For My Failing Gulp LESS Task Example: var gulp = require('gulp'), notify = require('gulp-notify'), less = require('gulp-less'), paths = { less : ['app/less/*.less'] }; gulp.task('less', function() { return gulp.src(paths.less) .pipe(less()) .pipe(concat('master.css')) .pipe(gulp.dest('app/build/css')) .pipe(notify({ message: 'Finished LESS Gulp Tasks'})); });

Click Here for TL;DR GulpJS is a Task/Build Runner. For more information on GulpJS you can visit there website. GulpJS is different from other solutions out there (i.e. Grunt) for several reasons. I'm going to touch on some of those reasons and show some example gulpjs files below: Streaming Through Pipes Gulp uses node streams. In a quick way, what this means and the benefit to us is that we can pass data straight from one task to another. This is one way in which GulpJS differs from another task runner like Grunt. Lets say, for example, you want to concat and then minify some javascript files. To do this with grunt you needs to concat all your files into a new file (lets say contact.js) and then minify that file to a new file (lets say minify.js). When this process is done you have a leftover file that was written to disk (concat.js) that you must now go and delete.