Find all the dependencies of one or more amd modules and sort them in the correct order, from leaf (module with no dependencies) to root (module which no other module depends on). This is an alternative to the official requireJS optimizer, but is designed
npm install amd-optimizerdefine() calls. If you call it with the option umd: true then it will try to find umd modules where the define call is not top-level. But to accept the define call it will need to be wrapped in an AMD test, like most of the examples on the UMD page. The define call in the following code will be found, and, if anonymous, will be named:
js
if (typeof define === 'function' && define.amd) {
define(['b'], factory);
}
if (typeof define === 'function' && define['amd']) {
define(['b'], factory);
}
factory(typeof define === 'function' && define.amd ? define : function(){});
``