Posts Tagged “RequireJS”

RequireJS Basics

Posted on April 11th, 2013 by webninjataylor

RequireJS loads scripts asynchronously and out of order for speed Define modules with dependencies Written in JS, so “.js” is not needed when declaring scripts to load <script src=”/Scripts/require.js” data-main=”/Scripts/app/main.js”></script> Contents of main.js could look like this… require([ “mylibs/utils”, “mylibs/palette” ], function(utils, palette){ // The app is loaded… } ); Defining dependencies in a JS […]