CodePen Module Loader

var module = Object.create({}, { _modules: { value: [] }, get: {value: function(name) { if(this._modules[name] !== undefined) return this._modules[name]; var modules = this._modules; for(var i = 0; i < modules.length; i++) { var module = modules[i]; if(module.name === name) return module; if(module[name] !== undefined) return module[name]; } }}, exports: { set: function(val) { this._modules.push(val); }, get: function() { return this._modules[this._modules.length-1]; } } });
Include this first in your CodePen to gain access to external RequireJS/AMD resources

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.