/*
Relative Module Identifiers:
http://livedocs.dojotoolkit.org/loader/amd#id8
http://livedocs.dojotoolkit.org/loader/amd#id9
A) Don’t use Relative Module Paths in require([]), only work in define([])
B) Don't use Relative Module Paths with global require use Context Sensitive _require
sample file:
path: dojo-boilerplate/js/myPackage/myModule/test3.js
no .js added at the end
*/
// !!! bad
// /dojo-boilerplate/mySubmodule9/b 404 (Not Found)
// /myModule8/a 404 (Not Found)
require(["../myModule8","./mySubmodule9"]);
define(["require","../myModule","./mySubmodule1"],function(_require){
// dojo-boilerplate/js/myPackage/myModule/mySubmodule3.js
require(["myPackage/myModule/mySubmodule3"]);
// !!! bad !!! dojo-boilerplate/mySubmodule4
require(["./mySubmodule4"]);
// dojo-boilerplate/js/myPackage/myModule/mySubmodule6.js
_require(["myPackage/myModule/mySubmodule5"]);
// dojo-boilerplate/js/myPackage/myModule/mySubmodule5.js
_require(["./mySubmodule6"]);
// dojo-boilerplate/js/myPackage/myModule7.js
_require(["../myModule7"]);
});
Tuesday, November 15, 2011
Relative Module Identifiers (dojo, AMD)
Subscribe to:
Post Comments (Atom)
Is this a bug or a feature ?
ReplyDelete