Skip to content

Instantly share code, notes, and snippets.

@PunchRockgroin
Last active December 17, 2015 13:29
Show Gist options
  • Save PunchRockgroin/5617423 to your computer and use it in GitHub Desktop.
Save PunchRockgroin/5617423 to your computer and use it in GitHub Desktop.
Example of working jQuery/Gumby Framework with Require.js, after replacing define(window.Gumby) with define('Gumby') in gumby.min.js
/*global define */
define(['jquery','gumby'], function () {
'use strict';
console.log('jQuery ' + $().jquery); // jQuery 1.9.1
console.log('Gumby is ready to go...', Gumby.debug()); //Gumby is ready to go... Object { $dom={...}, isOldie=false, uiModules={...}, more...}
});
require.config({
paths: {
'jquery': '../components/jquery/jquery', //Local jQuery
'gumby': '../components/gumby/js/libs/gumby.min'
},
shim: {
'gumby': {
deps: ['jquery'] //Shim to ensure jquery is loaded first
}
}
});
require(['jquery','app'], function ($, app) {
'use strict';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment