Skip to content

Instantly share code, notes, and snippets.

@mattidupre
Created April 14, 2014 18:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattidupre/10674447 to your computer and use it in GitHub Desktop.
Save mattidupre/10674447 to your computer and use it in GitHub Desktop.
Wrapper for converting jQuery plugins to CommonJS
(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