Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
commonjs/amd boilerplate
// shamlessly stolen from lodash
/*global define:false*/
;(function( window, undefined ) {
var freeExports = false;
if ( typeof exports === 'object' ) {
freeExports = exports;
if ( exports && typeof global === 'object' && global && global === global.global ) { window = global; }
}
var defineModule = function( $$deps$$ ) {
var $$module$$ = function() {};
return $$module$$;
};
if ( typeof define === 'function' && typeof define.amd === 'object' && define.amd ) {
// define as an anonymous module
define([ '$$deps$$' ], defineModule );
}
else if ( freeExports ) {
var $$deps$$ = require( '$$deps$$' );
var $$module$$ = defineModule( $$deps$$ );
// in Node.js or RingoJS v0.8.0+
if ( typeof module === 'object' && module && module.exports === freeExports ) {
module.exports = $$module$$;
}
// in Narwhal or RingoJS v0.7.0-
else {
freeExports.$$module$$ = $$module$$;
}
}
else {
// in a browser or Rhino
window.$$module$$ = defineModule( window.$$deps$$ );
}
}( this ));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.