Created
April 14, 2014 18:59
-
-
Save mattidupre/10674447 to your computer and use it in GitHub Desktop.
Wrapper for converting jQuery plugins to CommonJS
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 (factory) { | |
if (typeof exports === 'object') { | |
// CommonJS | |
factory(require('./jquery')); | |
} else { | |
// Standard globals | |
factory(jQuery); | |
} | |
}(function ($) { // or (jQuery) | |
// Plugin code goes here. | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment