-
-
Save iTonyYo/8598879 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
umd(function(require, exports, module) { | |
//... | |
},'my-module');function umd(fn,n){ | |
if(typeof define=='function')return define(fn); // AMD | |
if(typeof module=='object')return fn(require,exports,module); // CommonJS | |
var m={exports:{}};window[n]=fn(function(n){return window[n];},m.exports,m)||m.exports; // window | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment