cujojs / curl

curl.js is small, fast, extensible module loader that handles AMD, CommonJS Modules/1.1, CSS, HTML/text, and legacy scripts.
https://github.com/cujojs/curl/wiki
Other
1.88k stars 216 forks source link

define practical example #111

Closed jpxavier closed 12 years ago

jpxavier commented 12 years ago

newbie question: Can someone post a practical example of define with module id usage ? It appears to me that if you use a module id, the module has to be defined in its own file with the same name (unless you use some config options to remap it). define('module1',['depA','depB'], function(depA, depB){ // do some stuff return { } }); The above code must be defined in module1.js if I am not mistaken. to use the module, one would: require(['module1'] .....

What if I have 100's of modules that I would like to define ? Can I define more than one module in a js file?

Thanks

unscriptable commented 12 years ago

Hey @jpxavier, this sounds like a great topic for our brand new discussion group! :) We just put it up a few days ago. If not, I can answer here. -- J

unscriptable commented 12 years ago

https://groups.google.com/forum/#!forum/cujojs heh. link would be handy :)

jpxavier commented 12 years ago

Awesome! I will take a look.. thanks much. I do have a couple of loading issues. I will post on that site..

unscriptable commented 12 years ago

looking forward to your post(s). I'll close this issue, but re-open it if necessary. -- J