codeforamerica/blockee — pull request #13 by bensheldon (2012-10-09 05:49:59+00:00)
Title: Optimize release compilation

This pull request changes how the static assets are compiled when deploying: the "release" step has been removed from the Procfile and put into `package.json` as an install script. This means that assets are compiled only when new code is pushed to Heroku *not* every time the server is restarted. This means that Blockee will be able to "wake up" significantly faster if the Heroku instance is spun down.

Also, I refactored how the routes for static assets are set. It now pulls the routes as defined in the grunt.js configuration, removes redundant routes, and properly orders the routes to make sure that explicitly defined routes override default ones (e.g. when running `monolithic:release`).

Related: I would highly recommend you update your version of `bbb` as it's now 10 releases behind. If you do so, I would also recommend separating your server config/routes from your public asset compilation (e.g. grunt.js). You can see how I did this in [Super Mayor](https://github.com/bensheldon/super-mayor) by:

1. moving all public assets into a `/public` folder
2. performing compilation in an [NPM install hook](https://github.com/bensheldon/super-mayor/blob/master/package.json#L9)
3. serving development/release(compiled) assets depending on npm's [configuration environment](https://github.com/bensheldon/super-mayor/blob/master/server.js#L28) (e.g. `NODE_ENV`)

This makes maintaining the server much easier since it's separate from all the grunt.js cruft; it also makes updating bbb *much* easier (you're missing out on some sweet configuration/compilation improvements in both bbb and backbone-boilerplate)