Skip to content

Instantly share code, notes, and snippets.

@ngryman
Last active September 26, 2017 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngryman/80f0955ed4d168ff90e0 to your computer and use it in GitHub Desktop.
Save ngryman/80f0955ed4d168ff90e0 to your computer and use it in GitHub Desktop.
Simple UMD
!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 {}
})
@ORESoftware
Copy link

what is the ! for at the beginning?

@ORESoftware
Copy link

ORESoftware commented Jan 22, 2017

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