//the require library is configuring paths
require.config({
baseUrl: "../assets",
paths: {
//tries to load jQuery from Google's CDN first and falls back
//to load locally
log: ['log/log'],
ractive: ['//cdn.ractivejs.org/latest/ractive'],
rv: ["rv/rv"],
jquery: ['//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min', 'jquery/jquery'],
bootstrap: ['//netdna.bootstrapcdn.com/bootstrap/3.3.3/js/bootstrap.min', 'bootstrap/bootstrap'],
moment: ['moment/moment']
},
shim: {
'bootstrap': {
deps: ['jquery']
}
},
//how long the it tries to load a script before giving up, the default is 7
waitSeconds: 10
});
//requiring the scripts in the first argument and then passing the library namespaces into a callback
//you should be able to console log all of the callback arguments
require(['jquery', 'moment', 'log', 'ractive', 'rv'],
function ($, moment, log,Ractive, rv)
{
console.log(arguments, window.log);
log("Log by log");
});
})(require);
{
"private": true,
"ignore": [
"**/.*",
"node_modules",
"app/assets",
"bower_components",
"test",
"tests"
],
"dependencies": {
"bootstrap": "~3.3.4",
"jquery": "~2.1.3",
"fontawesome": "~4.3.0",
"moment": "~2.9.0",
"requirejs": "~2.1.16",
"rv": "~0.1.8",
"log": "~0.1.5"
}
}
{
"directory": "app/assets"
}