1
<div id="directory" class="section">
2
<h1>Download RequireJS</h1>
3
<ul class="index mono">
4
<li class="hbox"><a href="#latest">Latest Release</a><span class="spacer boxFlex"></span><span class="sect">§ 1</span></li>
6
<li class="hbox"><a href="#requirejs">require.js</a><span class="spacer boxFlex"></span><span class="sect">§ 1.1</span></li>
7
<li class="hbox"><a href="#rjs">r.js: Optimizer and Node/Rhino/xpcshell adapter</a><span class="spacer boxFlex"></span><span class="sect">§ 1.2</span></li>
9
<li class="hbox"><a href="#plugins">Plugins</a><span class="spacer boxFlex"></span><span class="sect">§ 2</span></li>
11
<li class="hbox"><a href="#text">text</a><span class="spacer boxFlex"></span><span class="sect">§ 2.1</span></li>
12
<li class="hbox"><a href="#domReady">domReady</a><span class="spacer boxFlex"></span><span class="sect">§ 2.2</span></li>
13
<li class="hbox"><a href="#cs">cs (CoffeeScript)</a><span class="spacer boxFlex"></span><span class="sect">§ 2.3</span></li>
14
<li class="hbox"><a href="#i18n">i18n</a><span class="spacer boxFlex"></span><span class="sect">§ 2.4</span></li>
16
<li class="hbox"><a href="#releasenotes">Release Notes</a><span class="spacer boxFlex"></span><span class="sect">§ 3</span></li>
22
<h2><a name="latest">Latest Release</a><span class="sectionMark">§ 1</span></h2>
24
<span class="note">If you want 1.0: <a href="1.0/">Link to 1.0</a>.</span>
26
<div class="subSection">
28
<a name="requirejs">require.js 2.1.8</a>
29
<span class="boxFlex"></span>
30
<a class="download" href="http://requirejs.org/docs/release/2.1.8/minified/require.js">Minified</a>
31
<a class="download" href="http://requirejs.org/docs/release/2.1.8/comments/require.js">With Comments</a>
34
<p>All you need to start using require.js in the browser.</p>
37
<div class="subSection">
39
<a name="rjs">r.js: Optimizer and Node/Rhino/xpcshell adapter</a>
40
<span class="boxFlex"></span>
41
<a class="download" href="http://requirejs.org/docs/release/2.1.8/r.js">Download</a>
44
<p>The r.js file allows you to run the optimizer as well as run modules in Node, Rhino or xpcshell.</p>
46
<p>If you are running in Node, and want to use npm to install this file via npm, see the <a href="node.html">Use with Node</a> page for more information.</p>
48
<p>For information on its use, as well as how to get the JAR files to run it under Rhino, see the <a href="https://github.com/jrburke/r.js">r.js README</a>.</p>
53
<h2><a name="plugins">Plugins</a><span class="sectionMark">§ 2</span></h2>
55
<p>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.</p>
57
<div class="subSection">
59
<a name="text">text</a>
60
<span class="boxFlex"></span>
61
<a class="download" href="https://raw.github.com/requirejs/text/latest/text.js">Download</a>
63
<p><a href="api.html#text">Load text files and treat them as dependencies</a>. Great for loading templates. The text strings can be inlined in an optimized build when the optimizer is used.</p>
66
<div class="subSection">
68
<a name="domReady">domReady</a>
69
<span class="boxFlex"></span>
70
<a class="download" href="https://raw.github.com/requirejs/domReady/latest/domReady.js">Download</a>
72
<p><a href="api.html#pageload">Wait for the DOM is ready</a>. Useful for pausing execution of top level application
73
logic until the DOM is ready for querying/modification.</p>
76
<div class="subSection">
78
<a name="cs">cs (CoffeeScript)</a>
79
<span class="boxFlex"></span>
80
<a class="download" href="https://github.com/jrburke/require-cs/raw/latest/cs.js">Download</a>
82
<p>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 <a href="#rjs">RequireJS adapter</a>. This is the best way to do cross-environment, modular CoffeeScript. <a href="https://github.com/jrburke/require-cs">The project home</a> has more information on how to install and use it.</p>
86
<div class="subSection">
88
<a name="i18n">i18n</a>
89
<span class="boxFlex"></span>
90
<a class="download" href="https://raw.github.com/requirejs/i18n/latest/i18n.js">Download</a>
92
<p><a href="api.html#i18n">Load string bundles</a> used in internationalization (i18n) that are made up of separate country/language/locale-specific bundles.</p>
98
<h2><a name="releasenotes">Release Notes</a><span class="sectionMark">§ 3</span></h2>
100
<h3 id="2-1-8">2.1.8</h3>
102
<p>A small release to fix an optimizer issue with <a href="https://github.com/jrburke/r.js/issues/476">parsing config calls for modifications</a>.</p>
104
<h3 id="2-1-7">2.1.7</h3>
106
<p>The main changes for this release:</p>
109
<li>For xpcshell, the optimizer uses the built in Reflect parser API instead of Esprima. xpcshell, on Linux and Windows in particular, has a constrained stack, and normal Esprima use was not possible. To accommodate this change, some of the parsing approaches used internally by r.js moved away from token scanning to tree walking. The only visible output change you may see is different use of space characters in transformed code.</li>
110
<li>The source map support was updated to use the new //# syntax as specified by the spec. This change is still making its way through the browsers, so if you need source map or sourceURL support with 2.1.7, you may need to use Firefox Aurora or Chrome Canary channels. The browser support levels should get better in around six weeks time.</li>
113
<p>Full list of changes:</p>
116
<li><a href="https://github.com/jrburke/requirejs/issues?direction=desc&milestone=28&page=1&sort=created&state=closed">Fixed require.js issues</a></li>
117
<li><a href="https://github.com/jrburke/r.js/issues?milestone=26&page=1&state=closed">Fixed r.js optimizer issues</a></li>
120
<h3 id="2-1-6">2.1.6</h3>
122
<p><a href="optimization.html#sourcemaps">Source map support</a> has been expanded. Previously, it was just supported for going from minified, bundled code to the unminified, bundled code. If <code>optimize: 'uglify2'</code> is used, it will now go back to the separated, unbundled files.</p>
124
<p>Source map support is still considered experimental though, so you may find bugs. If you find one, file an <a href="https://github.com/jrburke/r.js/issues">r.js issue</a>, ideally with a test case.</p>
126
<p>Full list of changes:</p>
129
<li><a href="https://github.com/jrburke/requirejs/issues?direction=desc&milestone=27&page=1&sort=created&state=closed">Fixed require.js issues</a></li>
130
<li><a href="https://github.com/jrburke/r.js/issues?milestone=25&page=1&state=closed">Fixed r.js optimizer issues</a></li>
134
<h3 id="2-1-5">2.1.5</h3>
136
<p>Biggest change is support for running the optimizer and loading AMD modules in
137
<a href="https://developer.mozilla.org/en-US/docs/XPConnect/xpcshell">xpcshell</a>. Other than that,
138
just a maintenance release.</p>
140
<p>Full list of changes:</p>
143
<li><a href="https://github.com/jrburke/requirejs/issues?direction=desc&milestone=26&sort=created&state=closed">Fixed require.js issues</a></li>
144
<li><a href="https://github.com/jrburke/r.js/issues?milestone=23&state=closed">Fixed r.js optimizer issues</a></li>
148
<h3 id="2-1-4">2.1.4</h3>
150
<p>Quick release for a bug that slipped in the 2.1.3 release in the r.js optimizer.
151
So even though require.js now has a 2.1.4 version, it is the same as 2.1.3,
152
and the optimizer is the same as 2.1.3 except for this one fix:</p>
155
<li><a href="https://github.com/jrburke/r.js/issues/356">Bug 356</a>: cssPrefix normalization always needs to happen</li>
158
<p>Without this fix, in some cases 2.1.3 would insert "undefined" in some
159
optimized CSS files, making them unusable.</p>
161
<h3 id="2-1-3">2.1.3</h3>
163
<p>Maintenance release. A change that may be noticeable:</p>
165
<p><a href="http://requirejs.org/docs/api.html#modulenotes-urls">require.toUrl()</a>
166
now correctly generates URLs for string values passed to it without an
167
extension. Previous versions of toUrl() would append a
168
".js" extension automatically. If you relied on that behavior, when you
169
update to 2.1.3, then you may need to do a code change to append the .js
170
extension yourself:</p>
172
<pre><code>require.toUrl('some/value') + '.js'</code></pre>
174
<p>The text plugin has been updated to also work with this change, so if you want
175
to generate non-extension paths for text resources, be sure to upgrade to
176
to the <a href="https://raw.github.com/requirejs/text/latest/text.js">2.0.4 version of text.js</a>.</p>
178
<p>Normal use of toUrl with a value that has an extension continues to work the same.</p>
180
<p>Full list of changes:</p>
183
<li><a href="https://github.com/jrburke/requirejs/issues?direction=desc&milestone=24&page=1&sort=created&state=closed">Fixed require.js issues</a></li>
184
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=21">Fixed r.js optimizer issues</a></li>
187
<h3 id="2-1-2">2.1.2</h3>
189
<p>The big changes for this release are in the optimizer:</p>
192
<li>The optimizer can now <a href="optimization.html#requirements">run in the browser</a>, to enable web-based custom builds of your library.</li>
193
<li>"uglify2" is an allowed "optimize" value now, using UglifyJS 2.1.11.</li>
194
<li>Experimental support for <a href="optimization.html#sourcemaps">source maps</a>.</li>
195
<li>The optimizer runs faster now, and has some <a href="optimization.html#turbo">speed options</a>.</li>
198
<p>Full list of changes:</p>
201
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=22&sort=created&direction=desc&state=closed">Fixed require.js issues</a></li>
202
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=20">Fixed r.js optimizer issues</a></li>
205
<h3 id="2-1-1">2.1.1</h3>
208
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=21&sort=created&direction=desc&state=closed">Fixed require.js issues</a></li>
209
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=19">Fixed r.js optimizer issues</a></li>
212
<h3 id="2-1-0">2.1.0</h3>
214
<p>See the <a href="https://github.com/jrburke/requirejs/wiki/Upgrading-to-RequireJS-2.1">Upgrading to 2.1 page</a>.
216
<h3 id="2-0-6">2.0.6</h3>
218
<p>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.</p>
220
<p>Complete list of fixes:</p>
223
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=20&sort=created&direction=desc&state=closed">Fixed require.js issues</a></li>
224
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=18">Fixed r.js optimizer issues</a></li>
227
<h3 id="2-0-5">2.0.5</h3>
229
<p>Probably the most notable changes:</p>
232
<li>require.js: fix for <a href="https://github.com/jrburke/requirejs/issues/392">a 'use strict' issue in Safari 6</a>: should only show up in certain non-optimized scenarios.</li>
233
<li>r.js optimizer: changed over to <a href="http://esprima.org/">esprima</a> for all dependency tracing. This set the stage for allowing some forms of <a href="https://github.com/jrburke/r.js/issues/72">JavaScript 1.8 to be optimized</a>, with the
234
help of some regexps.</li>
237
<p>Complete list of fixes:</p>
240
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=19&sort=created&direction=desc&state=closed">Fixed require.js issues</a></li>
241
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=17">Fixed r.js optimizer issues</a></li>
244
<h3 id="2-0-4">2.0.4</h3>
246
<p>Same as 2.0.3, but rolled back a change in r.js that caused a logging error.</p>
249
<li><a href="https://github.com/jrburke/r.js/issues/225">Fixed r.js logging rollback</a></li>
252
<h3 id="2-0-3">2.0.3</h3>
255
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=17&sort=created&direction=desc&state=closed">Fixed require.js issues</a></li>
256
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=15">Fixed r.js optimizer issues</a></li>
259
<h3 id="2-0-2">2.0.2</h3>
262
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=16&sort=created&direction=desc&state=closed">Fixed require.js issues</a></li>
263
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=14">Fixed r.js optimizer issues</a></li>
266
<h3 id="2-0-1">2.0.1</h3>
269
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=15&sort=created&direction=desc&state=closed">Fixed require.js issues</a></li>
270
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=13">Fixed r.js optimizer issues</a></li>
274
<h3 id="2-0-0">2.0.0</h3>
277
<li><a href="https://github.com/jrburke/requirejs/wiki/Upgrading-to-RequireJS-2.0">2.0 changes</a></li>
278
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=13&sort=created&direction=desc&state=closed">Fixed require.js issues</a></li>
279
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=10">Fixed r.js optimizer issues</a></li>
283
<h3 id="1-0-8">1.0.8</h3>
285
<p>Small bug fixes to:</p>
288
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=12&sort=created&direction=desc&state=closed">require.js</a></li>
289
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=9">r.js optimizer</a></li>
292
<h3 id="1-0-7">1.0.7</h3>
294
<p>Small bug fixes to:</p>
297
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=11&sort=created&direction=desc&state=closed">require.js</a></li>
298
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=8">r.js optimizer</a></li>
301
<h3 id="1-0-6">1.0.6</h3>
303
<p>Main purpose of the release is to fix a regression in 1.0.5 where the
304
optimizer's "dir" config option was not applied correctly when passed on the
307
<p>The other notable change: the optimizer now supports
308
<a href="https://github.com/jrburke/r.js/blob/master/build/example.build.js#L320">onBuildRead
309
and onBuildWrite</a> functions that are called when JS modules are read or written
310
for an optimized build layer. This allows doing some regexp work to modify their
313
<p>Small bug fixes to:</p>
316
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=10&sort=created&direction=desc&state=closed">require.js</a></li>
317
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=7">r.js optimizer</a></li>
320
<h3 id="1-0-5">1.0.5</h3>
322
<p>Small bug fixes to:</p>
325
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=8&sort=created&direction=desc&state=closed">require.js</a></li>
326
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=6">r.js optimizer</a></li>
329
<h3 id="1-0-4">1.0.4</h3>
331
<p>Small bug fixes to:</p>
334
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=7&sort=created&direction=desc&state=closed">require.js</a></li>
335
<li><a href="https://github.com/jrburke/r.js/issues?milestone=5&sort=created&direction=desc&state=closed">r.js optimizer</a></li>
338
<h3 id="1-0-3">1.0.3</h3>
340
<p>Small bug fixes to:</p>
343
<li><a href="https://github.com/jrburke/requirejs/issues?sort=created&direction=desc&state=closed&page=1&milestone=6">require.js</a></li>
344
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=4">r.js optimizer</a></li>
347
<h3 id="1-0-2">1.0.2</h3>
349
<p>Small bug fixes to:</p>
352
<li><a href="https://github.com/jrburke/requirejs/issues?sort=created&direction=desc&state=closed&page=1&milestone=5">require.js</a></li>
353
<li><a href="https://github.com/jrburke/r.js/issues?sort=created&direction=desc&state=closed&page=1&milestone=3">r.js optimizer</a></li>
356
<h3 id="1-0-1">1.0.1</h3>
358
<p>Just small bug fixes related to:</p>
361
<li>allowing full URLs for simplified CommonJS wrapped modules</li>
362
<li>AST parsing of dependencies for modules that use a variable for the factory function</li>
363
<li>catching more cases that should have the "namespace" optimizer option applied</li>
366
<p>Detailed list of changes for require.js and the r.js optimizer:</p>
369
<li><a href="https://github.com/jrburke/requirejs/issues?milestone=4&state=closed">require.js 1.0.1 changes</a></li>
370
<li><a href="https://github.com/jrburke/r.js/issues?milestone=2&state=closed">r.js 1.0.1 changes</a></li>