trainingwheels/trainingwheels — pull request #47 by elliotttf (2013-02-11 16:19:38+00:00)
Title: TW-99 require

This branch moves all of the JavaScript into [require.js](http://requirejs.org/) modules. This will help us organize the code a little better and keep the file sizes down.

I've also included a grunt build file, based largely on the [backbone-boilerplate-handlebars-layoutmanager](https://github.com/tbranyen/boilerplate-handlebars-layoutmanager) project. To rebuild the app's JS you can run the following command from anywhere under the ~/controller/web directory: ```grunt release```. You can also run ```grunt watch``` which will rebuild the app's CSS and JS any time a scss or js file changes.

The grunt process currently does the following:
* Deletes anything in the ~/controller/web/dist directory to ensure sources are overwritten
* Lints the JS source using [JSHint](http://www.jshint.com/about/) -- miraculously our code was pretty close to lint free when I set this up... go us!
* Manages source dependencies and concatenates our files using requirejs
* Concatenates vendor sources with application code
* Processes the compass code into CSS
* Minifies the JavaScript
* Minifies the CSS

When the application is set to "debug" mode in the ~/controller/config/config.yml file the un-minified versions of the CSS and JavaScript will be used in the app. Flip this to live mode though and we'll have nice, tiny, minified files to reduce our transport footprint :)