54 votesGregory Jacobs commented
Support for this is definitely needed with the growing popularity of AMD loaders and optimizers.
We're currently experiencing trouble with wanting to bundle Highcharts into our app code, but still load jQuery from CDN via RequireJS. In this case, the library expects jQuery to exist before it actually does, causing problems.
An "optional" AMD define() call can be made for when an AMD loader is present, while still creating the usual browser global. An example of how to wrap the library in this way is here: https://github.com/umdjs/umd/blob/master/amdWebGlobal.jsGregory Jacobs supported this idea ·