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/Nashorn 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.

2.1.18

The notable changes are in the r.js optimizer:

An update to Esprima 2.2.0 for dependency tracing. Helps properly parse modules that are using some ES2015 features, like template strings.

A fix for detecting when a script exports an publicly visible AMD API and should be hoisted in the built output. The new detection is a bit stricter than before, so if your script with the public AMD API is not hoisted, please open a r.js issue.

2.1.17

The notable changes are in the r.js optimizer: an update to Esprima 2.1.0 for dependency tracing, and a fix around "use strict" processing that should help some loader plugins or build scenarios that were using React.

2.1.16

The notable changes are in the r.js optimizer:

Esprima 2.0 is used by the optimizer when parsing modules for dependencies. This allows some ES6 features to be used. Whatever is parsable by Esprima 2.0 is what is supported (when running in xpcshell, Reflect.parse is still used).

Expanded support of some UMD-wrapped files that start with !function(a) {...`. If you use the UMD node package to generate your UMD wrappers, upgrade to umd@3.0.0 or later to get full compatibility with the r.js optimizer.

2.1.15

Mainly fixes a regression from 2.1.14 in the r.js optimizer where some define() calls were not found. The most common manifestations of the bug would be either an extra define('jquery', function(){}) in the build output or namespaced builds not working. The fixes for 2.1.15 are just in the optimizer. Full list of changes:

2.1.12

2.1.11

Some bug fixes, with the most notable addition is an optimizer option, wrapShim. This will wrap shimmed dependencies in a define() call so that they work better after a build when their upstream dependencies are also AMD modules with dependencies.

The most notable case is probably when using an AMD-aware version of Backbone, but using shim config for scripts that depend on Backbone. If this is your use case, then setting wrapShim: true in the optimizer config will likely fix any post-build problem you might see. More details in the bug ticket.

2.1.10

Mainly a maintenance release, and improves some cases when reusing code that was installed via npm. There are two new config options for the loader too:

nodeIdCompat: some node modules installed by npm use module IDs like example.js and example interchangeably. Setting this config option to true will accommodate that style. almond 0.2.9+ also supports this option.

bundles: a more compact way to list a set of module IDs belonging to a bundle ID, and supports loader plugin resource IDs.

And for the optimizer, the mainConfigFile option can now take an array of file paths that have configs in them. Later values take precedent over earlier values.

2.1.9

Full list of changes:

Mainly a maintenance release to fix bugs. There is a new skipDataMain option in require.js to avoid the data-main work, which can be useful for browser extensions that should let the main content page's requirejs handle the data-main.

2.1.8

2.1.7

The main changes for this release:

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.

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.

2.1.6

Source map support has been expanded. Previously, it was just supported for going from minified, bundled code to the unminified, bundled code. If optimize: 'uglify2' is used, it will now go back to the separated, unbundled files.

Source map support is still considered experimental though, so you may find bugs. If you find one, file an r.js issue, ideally with a test case.

2.1.4

Quick release for a bug that slipped in the 2.1.3 release in the r.js optimizer.
So even though require.js now has a 2.1.4 version, it is the same as 2.1.3,
and the optimizer is the same as 2.1.3 except for this one fix:

Without this fix, in some cases 2.1.3 would insert "undefined" in some
optimized CSS files, making them unusable.

2.1.3

Maintenance release. A change that may be noticeable:

require.toUrl()
now correctly generates URLs for string values passed to it without an
extension. Previous versions of toUrl() would append a
".js" extension automatically. If you relied on that behavior, when you
update to 2.1.3, then you may need to do a code change to append the .js
extension yourself:

require.toUrl('some/value') + '.js'

The text plugin has been updated to also work with this change, so if you want
to generate non-extension paths for text resources, be sure to upgrade to
to the 2.0.4 version of text.js.

Normal use of toUrl with a value that has an extension continues to work the same.

2.1.1

2.1.0

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.

2.0.0

1.0.8

1.0.7

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.