-
-
Save busticated/1348409 to your computer and use it in GitHub Desktop.
possible jquery plugin boilerplate
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(root, factory) { | |
if (typeof exports === 'object') { | |
// Node/CommonJS | |
factory(require('jquery')); | |
} else if (typeof define === 'function' && define.amd) { | |
// AMD. Use a named plugin in case this | |
// file is loaded outside an AMD loader, | |
// but an AMD loader lives on the page. | |
define('myPlugin', ['jquery'], factory); | |
} else { | |
// Browser globals | |
factory(root.jQuery); | |
} | |
})(this, function($) { | |
$.fn.myPlugin = function () {}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment