/*! * I basically want to generate this UMD with some tool. * Right now I did it manually by copying and pasting some generic one. * * But it is failing in some cases due to having in this same file the jQuery * adator you'll see at the bottom. */ (function( root, window, document, factory, undefined) { if( typeof define === 'function' && define.amd ) { // AMD. Register as an anonymous module. define( function() { root.fullpage = factory(window, document); return root.fullpage; } ); } else if( typeof exports === 'object' ) { // Node. Does not work with strict CommonJS. module.exports.fullpage = factory(window, document); } else { // Browser globals. window.fullpage = factory(window, document); } }(this, window, document, function(window, document){ 'use strict'; function initialise(){ console.log("fullpage.js code...."); } return initialise; })); /** * jQuery adapter for fullPage.js 3.0.0 */ if(window.jQuery && window.fullpage){ (function ($, fullpage) { if (!$ || !fullpage) { window.fp_utils.showError('error', 'jQuery is required to use the jQuery fullpage adapter!'); return; } $.fn.fullpage = function(options) { var FP = new fullpage('#' + $(this).attr('id'), options); //Static API Object.keys(FP).forEach(function (key) { $.fn.fullpage[key] = FP[key]; }); }; })(window.jQuery, window.fullpage); }