Skip to content

Instantly share code, notes, and snippets.

@dmikis
Created July 30, 2013 08:15
Show Gist options
  • Save dmikis/6111191 to your computer and use it in GitHub Desktop.
Save dmikis/6111191 to your computer and use it in GitHub Desktop.
AMD && CommonJS && Plain
(function () {
function factory(dep1, dep2) {
/* simple modile */
return function () { return dep1 + dep2; };
}
if (typeof define === 'function' && define.amd) {
define('simple', ['dep1', 'dep2'], factory);
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = factory(requrie('dep1'), require('dep2'));
} else {
this.simple = factory(dep1, dep2);
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment