Not all libraries are defined in a way that is compatible with AMD and RequireJS's define()
function. The author's have addressed this by including a shim
directive for configuring those dependencies.
One example is using the jQuery UI Layout Plugin. That plugin depends on jQuery. You can configure it like this:
requirejs.config({
paths: {
'jquery': '../path/to/jquery.min',
'jquery.layout': '../path/to/jquery.layout.min'
},
shim: {
'jquery.layout': {
deps: ['jquery']
}
}
});
And then use it in a layout module like this:
define(['jquery', 'jquery.layout'], function ($, layout) {
$('body').layout();
});