If you need to load a module both locally and from a remote URL, you must name the module, if defined , and add the module "alias", which is called as a URL, with both modules defined inside the same file .
Example:
//define a module NAMED "moment" using the first optional name paramter define("moment", ["require"], function (require) { /*module code goes here*/ }); //alias module to use when lazy loading from URL define("http://momentjs.com/downloads/moment.min.js", ["require"], function (require) { return require("moment");//returns original module });
You can read more about this in the blog post. I wrote here .
Yosi
source share