Skip to content

Instantly share code, notes, and snippets.

@xeaone
Created February 16, 2017 19:35
Show Gist options
  • Save xeaone/8733018a7bf45b48dba7dfce3844a788 to your computer and use it in GitHub Desktop.
Save xeaone/8733018a7bf45b48dba7dfce3844a788 to your computer and use it in GitHub Desktop.
A better way then umd
var NAME = '';
var MODULE = {} || function () {};
(function (t, n, m) {
if (typeof m === 'function') m = m(t);
if (typeof t.define !== 'undefined') t.define([n], m);
else if (typeof t.module !== 'undefined') t.module.exports = m;
else if (typeof t.window !== 'undefined') t.window[n] = m;
else return m;
}(this, NAME, MODULE));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment