Secondly: Oh my yes… promises

We’d like to pass arguments to some utility tasks, for example clean. This means we’re unable to only use the dependancy feature of Gulp’s task runner Orchestrator. It’d also be nice to have generic versions of some tasks which can be reused.

gulp.task('some-task',['clean'],function(){// Clean is done... but what did I clean? Did I have to clean all of that?// Do I write multiple versions of clean which do esstenially the same thing?});

Great, now we can pass arguments to utility and generic tasks. We have one version of the style task here which revs the output file and makes sure to update our index.html, and one version which doesn’t.

Both tasks return Orchestrator-able promises such that we can still use task dependency when it makes sense:

Thirdly, push it

The last piece of the puzzle is figuring out a tidy deployment strategy for the built app. For apps which are deployed to S3 this isn’t really a problem, for Apps which are being served from the Rails public directory it is. We currently check the built app into the repo to ease deployment, however this introduces conflict hell. The conflicts are so easily resolved that we haven’t made fixing it a priority, however it does need to be tackled.

Aaand we’re done

We’re loving working with Gulp, it’s fast, functional and super flexible. We’re always working on how we build and deploy our AngularJS applications, so … stay tuned!