Created
March 4, 2017 22:55
-
-
Save KennethanCeyer/19402abf4901a833052319ece54119d4 to your computer and use it in GitHub Desktop.
Supporting AMD and CommonJS, and Plaintype.
This file contains 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 define !== 'undefined' && define.amd) { | |
// AMD loader type declaration. | |
define(['jquery', 'moment'], function(jquery, moment) { | |
factory(window, document, jquery, moment); | |
}); | |
} else if(typeof module === 'object') { | |
var jsdom = require('jsdom').jsdom; | |
var _document = jsdom('<html></html>', {}); | |
var _window = _document.defaultView; | |
var _jquery = require('jquery')(_window); | |
var _moment = require('moment'); | |
module.exports = factory(_window, _document, _jquery, _moment); | |
} else { | |
root.pignoseCalendar = factory(window, document, jQuery, moment); | |
} | |
} (this, function (window, document, jquery, moment) { | |
// definition of the library. | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment