modulePaths.html
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<html>
<head>
<script>
var dojoConfig= {
modulePaths: {
"foo":"../foo/bar",
"abs":"http://myHost/myPath",
"some.multiSegment.path":"../someOther/path"
}
};
</script>
<script type="text/javascript" src="../../../dojo.js"></script>
<script type="text/javascript">
// TODO: make these DOH tests and add to unit test modules
require(["dojo"], function(dojo) {
console.log(dojo.moduleUrl("notFoo")+"");
console.log(dojo.moduleUrl("notFoo/someModule")+"");
console.log(dojo.moduleUrl("foo")+"");
console.log(dojo.moduleUrl("foo/someModule")+"");
console.log(dojo.moduleUrl("abs")+"");
console.log(dojo.moduleUrl("abs/someModule")+"");
console.log(dojo.moduleUrl("some/multiSegment/notPath")+"");
console.log(dojo.moduleUrl("some/multiSegment/path")+"");
console.log(dojo.moduleUrl("some/multiSegment/path/someModule")+"");
dojo.registerModulePath("foo", "./foo2/bar");
dojo.registerModulePath("yet/another/foo", "./yetAnotherFoo");
console.log(dojo.moduleUrl("foo")+"");
console.log(dojo.moduleUrl("foo/someModule")+"");
console.log(dojo.moduleUrl("yet/another/foo")+"");
console.log(dojo.moduleUrl("yet/another/foo/someModule")+"");
});
</script>
</head>
<body>
</body>
</html>