I\'m incorporating SignalR into a project where I\'m already using require.js to handle my scripts dependencies.
I\'m having a little
This works for me with SignalR 1.1.2:
require.config({
baseUrl: "/<your scripts dir>",
paths: {
"jquery": "jquery-<your jquery version>.min",
"signalr.core": "jquery.signalR-<your signalr version>.min",
"signalr.hubs": "/signalr/hubs?"
},
shim: {
"jquery": {
exports: "$"
},
"signalr.core": {
deps: ["jquery"],
exports: "$.connection"
},
"signalr.hubs": {
deps: ["signalr.core"],
}
}
});
require(["jquery", "signalr.hubs"],
function($)
{
var hubProxy = $.connection.myHub;
// ... go to town ...
});