Skip to content

Commit c2276aa

Browse files
committed
Merge pull request #5 from Jakobo/master
Adding inject as AMD compliant loader
2 parents a12b064 + 0477fcb commit c2276aa

File tree

3 files changed

+1487
-0
lines changed

3 files changed

+1487
-0
lines changed

impl/inject/config.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
Note: When running the tests for the inject loader make sure localStorage has been
3+
cleared for the first run to ensure the latest version of the tests are executed.
4+
Either clear the browser cookies or programatically run localStorage.clear();
5+
*/
6+
function setModuleRoot() {
7+
var url = location.href.split("?")[0],
8+
base = url.substr(0, url.lastIndexOf("/"));
9+
Inject.require.setModuleRoot(base);
10+
}
11+
12+
Inject.reset();
13+
var config = function(pathObj) {
14+
for(var key in pathObj.paths) {
15+
Inject.require.addRule(key, {path:pathObj.paths[key]});
16+
}
17+
},
18+
go = function() {
19+
setModuleRoot();
20+
Inject.require.apply(this, arguments);
21+
},
22+
implemented = {
23+
basic: true,
24+
anon: true,
25+
funcString: true,
26+
namedWrapped: true,
27+
require: true
28+
// plugins: true
29+
// pluginDynamic: true
30+
};
31+
require = undefined;

0 commit comments

Comments
 (0)