Download RequireJS

Latest Release§ 1

require.js 1.0.3 Minified With Comments

All you need to start using require.js in the browser.

Sample RequireJS 1.0.3 + jQuery 1.7.1 project Download

A zip file containing a sample project that uses jQuery and RequireJS.

r.js: Optimizer and Node and Rhino adapter Download

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.

Plugins§ 2

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.

text Minified With Comments

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.

domReady Minified With Comments

Wait for the DOM is ready. Useful for pausing execution of top level application logic until the DOM is ready for querying/modification.

order Minified With Comments

Load script in the order specified in the dependency array. Useful for existing scripts that have implied dependencies instead of calling define() to create modular code.

cs (CoffeeScript) With Comments

Load files written in CoffeeScript. Includes a version of CoffeeScript, only this one file is needed. 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 use it.

i18n Minified With Comments

Load string bundles used in internationalization (i18n) that are made up of separate country/language/locale-specific bundles.

Release Notes§ 3

1.0.3

Small bug fixes to:

1.0.2

Small bug fixes to:

1.0.1

Just small bug fixes related to:

Detailed list of changes for require.js and the r.js optimizer:

1.0.0

Same as RequireJS 0.27.1 release, with some document updates and a small fix to the optimizer's regular expression for converting CommonJS modules to AMD.

0.27.1

RequireJS 1.0 release candidate. Small bugfixes for 0.27.0:

0.27.0

RequireJS 1.0 release candidate.

0.26.0

0.25.0

The awesome part: the optimizer is now just one JS file! It also doubles as a bootstrap script that supports the full capability of AMD modules and loader plugins in Node and in Rhino.

To use the optimizer, pass the "-o" option to r.js:

    node r.js -o app.build.js

To run your AMD-based project via the adapter (assuming server.js is your top-level AMD module):

    node r.js server.js

There is more information about running AMD modules in Node. The optimizer docs have been updated to the new optimizer syntax, and the r.js script has its own project now, to allow releases that are decoupled from require.js.

Other highlights:

Some changes in the name of compatibility with other AMD module loaders and Node:

A small change to the context-specific require() passed to a loader plugin's load() call: require.isDefined() is now require.defined() and there is require. specified().

0.24.0

0.23.0

0.22.0