Reputation: 1
I want to use crossroads.js with require.js to determine what file to require based on the URL.
I have crossroads set as a dependancy in a Router.js file and if I console.log(crossroads) straight out from the crossroads.js file I get the crossroads object. However it isnt getting passed to the Router.js file, its null or undefined... Wonder if anyone has had this issue before?
Cheers in advance.
Upvotes: 0
Views: 1019
Reputation: 1256
Crossroads.js works with RequireJS since the beginning (I use RequireJS on all my projects) you probably had some misconfiguration on your paths or expected the global crossroads
var to be exposed (which doesn't happen on an AMD environment) or maybe crossroads was being loaded before RequireJS (which would skip the AMD define
process).
Upvotes: 1