Setting publicPath for webpack-dev-server in API mode

Recently I had an issue whereby running webpack-dev-server –content-base www from the command line was working great, but as soon as I tried to automate it as a gulp task my bundle seemed to never reload properly. new WebpackDevServer(webpack(webpackConfig), { contentBase: "www" }).listen(8080, ‘localhost’, noop); Functionally I had assumed that this would be equivalent to the previous command line version. I could see the server was correctly detecting changes and reloading the page but the content never changed.
Read more →

Debugging Cordova Android apps in IntelliJ 13

Debugging an Android app in IntelliJ is fairly straightforward. It’s slightly harder to figure out how to spin up a cordova app. First things first we need to define an android module. The only way I’ve got this to work is by importing a module rather than creating a new one. Open the project structure and go to modules screen. right click your project and select add > import module. In theory the wizard should allow you to set up everything you need.
Read more →

Exploring Metalsmith

Update - 10th June 14: I’ve extracted the JSON parsing features from the following code into a metalsmith plugin, metalsmith-json, whcih is now available on github and npm A few weeks ago, I read about Metalsmith, a neat looking static site generator. More recently I was looking at ways of improving an internal static site we maintain as a gateway to download and install mobile artifacts. It seemed like a good opportunity to play with Metalsmith and I’d like to talk through my experience.
Read more →

Inlining grunt tasks

Grunt config files can easily become very verbose and disparate with related tasks scattered far apart. Without careful organisation and maintenance they can become quite unwieldy. In this post I’ll discuss some of the ways I’ve been experimenting with to make gruntfiles terser and keep related components together. I’ll introduce the grunt-inline-task-sugar plugin which I created to implement some of the ideas discussed. Anatomy of the alias task The grunt ‘alias’ task type is probably familiar to you:
Read more →

Adding a directed task graph to grunt

Last year we migrated our build system for a multi platform cordova app to Grunt from ant. It was great. Well, actually it was just quite good. See, whilst I’m really not a fan of ant, the ant task graph is nice. It upsets me that I can’t express branching task dependencies in Grunt. ####The problem In this case we wanted to do a bunch of common setup once then do n platform specific steps for n platforms.
Read more →