Index: lib/compat.js |
diff --git a/lib/compat.js b/lib/compat.js |
index 9a78e434dfd2c46071d5b920501034d1d9054e80..9b52aeca23227d2eb2e6a941bbcd7328df7d89a0 100644 |
--- a/lib/compat.js |
+++ b/lib/compat.js |
@@ -21,15 +21,15 @@ |
function require(module) |
{ |
- var result = require.scopes[module]; |
- if (typeof result == "function" && !(module in require.loaded)) |
+ if (!(module in require.scopes)) |
{ |
- result = require.scopes[module] = result(); |
- require.loaded[module] = true; |
+ let scope = {exports: {}}; |
+ require.scopes[module] = require.modules[module](scope, scope.exports, |
+ require); |
} |
- return result; |
+ return require.scopes[module]; |
} |
-require.loaded = Object.create(null); |
+require.modules = Object.create(null); |
require.scopes = Object.create(null); |
function importAll(module, globalObj) |
@@ -79,6 +79,9 @@ var Components = |
}, |
results: {}, |
utils: { |
+ import: function() |
kzar
2016/11/18 17:22:41
For some reason I needed to add this, I have no id
|
+ { |
+ }, |
reportError: function(e) |
{ |
console.error(e); |