I'm getting a little frustrated with requirejs at this point.
I'm trying to load jquery and other libraries in my App.coffee file. The problem is that I can't load module dependencies in my define. Some of the input arguments (jq, jsn, etc) are null or just HTMLDocument objects. This changes based on the permutation of plugins that I try: 'order', 'domReady', or none.
My js lib directory looks like A). And my App.coffee file looks like B). I've tried to use 'paths' in the require.config and just raw file referencing (what you see below). I'm aware of requirejs-jquery integration. But shouldn't I be able to order my plugin loading?
I get a different set of errors if I try named 'paths'. I see someone suggested jquery 1.7 (also here). Is this working? I first wanted to take a step back and make sure that I have the concepts down correctly. i) require.config ii) module definition w/ dependencies, iii) the order plugin, etc.
If I have these concepts down correctly, I would think it's a jquery version issue. However, it's not just jquery as a dependency. And it's incredibly irksome to lose time in this manner. Any help is appreciated. Thanks in advance.
A)
$ tree js/lib/ js/lib/ ├── backbone.js ├── backbone_loader.js ├── domReady.js ├── jquery-1.6.3.js ├── json2.js ├── order.js ├── pure.js ├── require.js └── underscore.js
B)
require.config({ baseUrl: "/js", paths: order : '/js/lib/order' jQuery : '/js/lib/jquery-1.6.3' json2 : '/js/lib/json2' Underscore : '/js/lib/underscore' Backbone : '/js/lib/backbone_loader' pure : '/js/lib/pure' }) define( [ 'js/lib/order!js/lib/jquery-1.6.3', 'js/lib/order!js/lib/json2', 'js/lib/order!js/lib/underscore', 'js/lib/order!js/lib/backbone', 'js/lib/order!js/lib/pure', 'js/lib/order!js/bkeeping/models', ] (jq, jsn, und, bbn, pur, models) -> console.log('bkeeping LOADED') # return an object with the models in it models : models jQuery : jq.noConflict() json2 : jsn Underscore : und.noConflict() Backbone : bbn.noConflict() pure : pure )