<script src="module8.js"></script> <script src="module6.js"></script> <script src="module12.js"></script> <script src="module15.js"></script> ... That's what they are afraid of
here is not a technical problem. It’s a matter of people getting together and making a decision to step forward and start building up something bigger and cooler together.” Kevin Dangoor
from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order" and something that was easy to use directly in the browser.” require.js documentation
baseUrl: paths: shim: map: config: waitSeconds: scriptcontext: deps: enforceDefine: urlArgs: ... the root path to use for all module lookups paths for module names not found under baseUrl dependencies and exports for not AMD scripts substitute a module ID passes configuration info to a module seconds to wait before giving up on loading a script allows require.js to load multiple versions of modules an array of dependencies to load throws an error if a script doesn't call define() query string args appended to URLs ...
"../build", paths: { text: "external/require/text" , jquery: "external/jquery-edge" }, modules: [ { name: "__core__" } ] }) folder that contains an app folder to save an output paths from require.config modules to optimize all dependencies will be included in a build file
exports ) { //If "a" has used exports, then we have a real //object reference here. However, we cannot use //any of a's properties until after b returns a value. exports.foo = function() { return a.bar(); }; });
variables · Follows CommonJS specification · Dependencies · No need to worry about loading order · Makes it easier to manage js-templates · Optimization · Works in all browsers · Works with old scripts · Easy to implement and use