I’m working on a fairly large web app in which I am going to be using require.js so I can compile it once it’s ready for production, but I would like to use backbone-relational. I am also going to be using backbone-marionette, but I am not sure how it would be included in the define function of modules.
Does anyone have any experience with this?
I’m using Backbone Marionette with Relational and loading them with Require.js. The basic idea is that you need to ensure Relational is loaded. One way to do it is to include Relational as a requirement whenever you define a Relational model.
In my project, I created a simple script called
bbloader.js(Backbone Loader) that loads all the relevant backbone models:And then throughout the project, I require
bbloaderinstead of Backbone. For example:Backbone Relational is already AMD compatible, so you shouldn’t need to do anything extra there.