Created
February 9, 2019 21:59
-
-
Save TehShrike/15d93f8246fd647c47d18f3b149a4e2f to your computer and use it in GitHub Desktop.
Wrap CommonJS into a UMD-like thingy
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
const yourModule = (() => { | |
const module = { exports: {} } | |
/* your module here */ | |
module.exports = { | |
test: true, | |
} | |
/* end your module */ | |
return module.exports | |
})() | |
console.log(yourModule) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment