public
Last active

sample requirejs cdn configuration

  • Download Gist
config.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
require.config({
paths:{
'jquery':'//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min',
'lodash':'//cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.2/lodash.min',
'foundation':'//cdnjs.cloudflare.com/ajax/libs/foundation/3.2.2/javascripts/foundation.min',
'text':'//cdnjs.cloudflare.com/ajax/libs/require-text/2.0.3/text'
}
});
require([
'jquery',
'lodash',
'foundation'
],function($,_){
console.log("jquery",$.fn.jquery);
console.log("lodash",_.VERSION);
UNDERSCORE = _;
JQUERY = $;
})
index.html
HTML
1
<script data-main="config" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.1/require.min.js"></script>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.