modularize code, add dummy version of roverd

This commit is contained in:
legop3
2025-11-12 01:13:29 -05:00
parent b5ce6706d6
commit 73b1b44c35
41 changed files with 1018 additions and 401 deletions
+22
View File
@@ -0,0 +1,22 @@
(function () {
const modules = {};
const cache = {};
window.registerModule = function (name, factory) {
modules[name] = factory;
};
window.requireModule = function (name) {
if (cache[name]) {
return cache[name];
}
const factory = modules[name];
if (!factory) {
throw new Error(`Module ${name} not found`);
}
const exports = {};
cache[name] = exports;
factory(requireModule, exports);
return exports;
};
})();