Last active
September 26, 2017 16:01
-
-
Save ngryman/80f0955ed4d168ff90e0 to your computer and use it in GitHub Desktop.
Simple UMD
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
!function(root, factory) { | |
if ('function' === typeof define && define.amd) | |
define('mymodule', [], function() { return (root.mymodule = factory()) }) | |
else if ('object' === typeof module && module.exports) | |
module.exports = factory() | |
else | |
root.mymodule = factory() | |
}(this, function() { | |
'use strict' | |
return {} | |
}) |
does this work with ES6 modules (default exports)?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what is the ! for at the beginning?