Created
October 9, 2018 07:39
-
-
Save copyrighthero/5327b04114d3adf747926de45c10e94d to your computer and use it in GitHub Desktop.
UMD ECMAScript
This file contains hidden or 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
((global, factory) => { | |
'use strict'; | |
// module identifier | |
const identifier = 'identifier'; | |
// module exportation | |
if (typeof define === 'function' && define.amd) { | |
// AMD module | |
define([], factory); | |
} else if (typeof module === 'object' && module.exports) { | |
// CommonJS-Like module | |
module.exports = factory(); | |
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { | |
// CommonJS strict module | |
exports[identifier] = factory(); | |
} else { | |
// Global module | |
global[identifier] = factory(); | |
} | |
})(this, () => (() => { | |
'use strict'; | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment