thomasdavis/backbonetutorials — pull request #67 by headwinds (2012-12-01 18:04:31+00:00)
Title: Adding r.js support

Hey Thomas,

in your intro you recommend r.js but don't exactly use it for the examples - at least not in the modular-backbone one. So I decided to try learn how it works using that example. After several failed attempts to configure it I finally got it working (prompting this pull request) but I'd like to get your opinion on my approach. I think there could be a better way but I don't know enough syntax for r.js - perhaps you do.

Ideally, when I build this project, I'd like the final main-built js file to appear in a separate directory with a new index.html which would use it. This separate directory would also have the supporting images and css folders. Instead of a separate directory, I ended with a simply main-built.js file and then I manually had to create a index-prod.html file to use and all this source is in the same "modular-backbone" directory.

How would one setup the build.js to produce this file structure within a new "app-built" directory? And give us a structure something like this:

modular-backbone-built
> index.html
> scripts
> > main-built.js
> css
> > style.css
> imgs

or what would you recommend?