Download RequireJS

Latest Release§ 1

If you want 1.0: Link to 1.0.

require.js 2.1.0 Minified With Comments

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

Sample RequireJS 2.1.0 + jQuery 1.8.2 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 Download

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 Download

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

cs (CoffeeScript) Download

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.

i18n Download

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

Release Notes§ 3

2.1.0

See the Upgrading to 2.1 page.

2.0.6

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:

2.0.5

Probably the most notable changes:

Complete list of fixes:

2.0.4

Same as 2.0.3, but rolled back a change in r.js that caused a logging error.

2.0.3

2.0.2

2.0.1

2.0.0

1.0.8

Small bug fixes to:

1.0.7

Small bug fixes to:

1.0.6

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:

1.0.5

Small bug fixes to:

1.0.4

Small bug fixes to:

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: