Last active
December 25, 2015 22:39
-
-
Save mattmccray/7051748 to your computer and use it in GitHub Desktop.
Support js modules in: browsers, web workers, and commonjs (node) environments in one line of code!
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
| MyModule= {} # Whatever | |
| # Magic export | |
| @MyModule= (@module or module or {}).exports= MyModule |
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
| (function() { | |
| var MyModule={ /* Whatever */ }; | |
| // Magic export | |
| this.MyModule= (this.module || module || {}).exports= MyModule; | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment