Skip to content

Instantly share code, notes, and snippets.

@thomasdavis
Created October 12, 2011 00:49
Show Gist options
  • Save thomasdavis/1279910 to your computer and use it in GitHub Desktop.
Save thomasdavis/1279910 to your computer and use it in GitHub Desktop.
UMD Suggestion
// AMD and Plain Enviroment - For the browser so no Common.js needed
if(typeof define !== 'function') {
define = function( deps, definition ) {
window['MyPlugin'] = definition();
}
}
define([], function(){
return {};
});
// Plain Enviroment - MyPlugin();
// AMD - define(['plugin'], function(MyPlugin){ MyPlugin(); });
@thomasdavis
Copy link
Author

Any quick drawbacks with this approach?

@jrburke @addyosmani

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment