Can we export multiple non-AMD functions from a module in requirejs?
If I have a non-AMD module named old.js and inside this script I have two
functions f1 and f2 defined. I need to use them, how do I export both?
require.config({
paths: {
"jquery":
"https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min",
},
shim: {
"old": {
deps: ["jquery"],
exports: ["f1", "f2"]
}
},
urlArgs: "bust=" + (new Date()).getTime()
});
This wouldn't work. I will get split error. The doc doesn't mention
multiple (http://requirejs.org/docs/api.html#config-shim) I assume this is
because even those jquery examples are individual files and they have
"entry" function / class.
No comments:
Post a Comment