Skip to content

Instantly share code, notes, and snippets.

@eridal
Forked from paton/simple.js
Created Oct 30, 2015
Embed
What would you like to do?
Super simple implementation of define() and require() used in Localize.js (https://localizejs.com)
var define, require;
(function() {
var modules = {};
require = function(name) {
return modules[name]();
};
define = function(name, fn) {
var exports;
modules[name] = function() {
if (!exports) {
exports = {};
exports = fn(require, exports) || exports;
}
return exports;
};
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment