Last active
December 17, 2015 13:29
-
-
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
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
/*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...} | |
}); |
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
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