Open xles opened 11 years ago
I've not used UMD before but requirejs allows you to have 'shims' for non AMD libraries - http://requirejs.org/docs/api.html#config-shim.
In this case you could do:
requirejs.config({
shim: {
'davis': {
deps: [''jquery'],
exports: 'Davis'
}
}
});
Yeah I know, and a shim works just fine, but I wanted to load it as a native AMD module, for no good reason, really.
And UMD is basically an AMD auto-detection shim with fallback to browser globals.
I've forked the project and started fiddling around a little bit more seriously. After looking at the makefile and realising that the entire build process was a simple concatenation, I felt a bit silly leaving the previous statements up there...
You can probably expect a future pull request in a not too distant future...
So, in my latest project I decided to go the RequireJS route, and unfortunately Davis.js didn't have AMD support. Which is a damned shame, because I really wanted to use Davis.js.
However, I did manage to get Davis.JS loaded and working. Unfortunately I'm somewhat new to serious JavaScript development so I'm rather clueless as to where in the sources to add this stuff, so I don't have a pull request to offer... I do have a gist to offer, though, if anyone feels up to the task: https://gist.github.com/xles/6293788
I will continue to fiddle around with UMD and see if I can't get that working. If I do I'll let you know, and if I figure out what goes where in the sources I'll send a pull request (but don't hold your breath, I'm somewhat dense at times).