All you need to start using require.js in the browser.
A zip file containing a sample project that uses jQuery and RequireJS.
The r.js file allows you to run the optimizer as well as run modules in Node or Rhino.
If you are running in Node, and want to use npm to install this file via npm, see the Use with Node page for more information.
For information on its use, as well as how to get the JAR files to run it under Rhino, see the r.js README.
These are useful loader plugins that have the same license terms as require.js itself. Download the plugin file and place it as a sibling to your "data-main" main.js script.
Load text files and treat them as dependencies. Great for loading templates. The text strings can be inlined in an optimized build when the optimizer is used.
Wait for the DOM is ready. Useful for pausing execution of top level application logic until the DOM is ready for querying/modification.
Load files written in CoffeeScript. With this plugin, it is easy to code in CoffeeScript in the browser, it can participate in the optimizer optimizations, and it works in Node and Rhino via the RequireJS adapter. This is the best way to do cross-environment, modular CoffeeScript. The project home has more information on how to install and use it.
Load string bundles used in internationalization (i18n) that are made up of separate country/language/locale-specific bundles.
See the Upgrading to 2.1 page.
The main focus of this release was cleaning up some rough edges after switching to esprima for all module parsing. Most notably, findNestedDependencies should work correctly again. The bundled UglifyJS was updated to 1.3.3 too.
Complete list of fixes:
Probably the most notable changes:
Complete list of fixes:
Same as 2.0.3, but rolled back a change in r.js that caused a logging error.
Small bug fixes to:
Small bug fixes to:
Main purpose of the release is to fix a regression in 1.0.5 where the optimizer's "dir" config option was not applied correctly when passed on the command line.
The other notable change: the optimizer now supports onBuildRead and onBuildWrite functions that are called when JS modules are read or written for an optimized build layer. This allows doing some regexp work to modify their contents.
Small bug fixes to:
Small bug fixes to:
Small bug fixes to:
Small bug fixes to:
Small bug fixes to:
Just small bug fixes related to:
Detailed list of changes for require.js and the r.js optimizer: