-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrequire.js
More file actions
33 lines (26 loc) · 740 Bytes
/
require.js
File metadata and controls
33 lines (26 loc) · 740 Bytes
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
!function(window) {
var modules = {}
, process = window.process = {
env: {}
}
//process.memoryUsage = function() {
// return (window.performance || {}).memory || {}
//}
window.require = require
function require(name) {
var mod = modules[name]
if (!mod) throw Error("Module not found: " + name)
if (typeof mod == "string") {
var exports = modules[name] = {}
, module = { id: name, filename: name, exports: exports }
Function("exports,require,module,process,global", mod).call(
exports, exports, require, module, process, window
)
mod = modules[name] = module.exports
}
return mod
}
require.def = function(map, key) {
for (key in map) modules[key] = map[key]
}
}(this) // jshint ignore:line