Suppose that "jQuery2" is distributed as a single es-next module and I want
to distribute a module that depends on it. I would expect to be able to
write something like this:
The end user of this module may want to actually load the "jquery2" module
from somewhere else, though (perhaps from a CDN or locally). If I
understand the module loaders proposal correctly, the user would need to
create a new loader to map the module url:
var MyLoader = SystemLoader.create(SystemLoader.intrinsics, {
resolve: function(url) {
if (url === "code.jquery.com/jquery2.js")
return "/local-scripts/jquery2.js";
else
return url;
}
});
MyLoader.load("whiz-bang.js");
Is that correct?
Suppose that "jQuery2" is distributed as a single es-next module and I want
to distribute a module that depends on it. I would expect to be able to
write something like this:
module jQuery2 from "http://code.jquery.com/jquery2.js";
export function whizBang() {
/* Use jQuery2 */
}
The end user of this module may want to actually load the "jquery2" module
from somewhere else, though (perhaps from a CDN or locally). If I
understand the module loaders proposal correctly, the user would need to
create a new loader to map the module url:
var MyLoader = SystemLoader.create(SystemLoader.intrinsics, {
resolve: function(url) {
if (url === "http://code.jquery.com/jquery2.js")
return "/local-scripts/jquery2.js";
else
return url;
}
});
MyLoader.load("whiz-bang.js");
Is that correct?
- khs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110819/d8896722/attachment.html>
Suppose that "jQuery2" is distributed as a single es-next module and I want to distribute a module that depends on it. I would expect to be able to write something like this:
module jQuery2 from "code.jquery.com/jquery2.js";
export function whizBang() { /* Use jQuery2 */ }
The end user of this module may want to actually load the "jquery2" module from somewhere else, though (perhaps from a CDN or locally). If I understand the module loaders proposal correctly, the user would need to create a new loader to map the module url:
var MyLoader = SystemLoader.create(SystemLoader.intrinsics, { resolve: function(url) { if (url === "code.jquery.com/jquery2.js") return "/local-scripts/jquery2.js"; else return url; } });
MyLoader.load("whiz-bang.js");
Is that correct?