I have the following (extremely simple) module definition, in CoffeeScript:
# backbone/routers/appointments_router.js.coffee
define ["app", "underscore", "backbone"], (App, _, Backbone) ->
console.log(Backbone)
And here's my config and stuff:
# application.js.coffee
requirejs.config
paths:
underscore: "lodash.min"
backbone: "backbone"
appointmentsRouter: "backbone/routers/appointments_router"
"backbone-relational": "backbone-relational"
requirejs ["app", "underscore", "backbone", "appointmentsRouter"], (App, _, Backbone, AppointmentsRouter) ->
Here's what's happening: when I load my page, I get undefined
in the console, even though Backbone is listed as a dependency. What's even more puzzling is that if I type Backbone
into the console, Backbone is defined.
How could it be that Backbone is ultimately getting evaluated, but my appointments_router.js.coffee
doesn't know about Backbone?