最新版本
如果你要下载 1.0 版本: 转到 1.0 版本.
require.js 2.1.11下载(压缩版) 下载(原版)
你在浏览器中使用所需要的功能。
r.js: Optimizer and Node/Rhino/xpcshell adapter下载
r.js 可以让你进行优化并能够在 Node, Rhino 或者 xpcshell 中运行.
如果你正在运行在 Node,并且希望使用NPM通过NPM安装文件, 请查看 Node 加载页面获取更多信息。
其它使用信息, 以及如何得到 JAR 文件在 Rhino 中运行, 请查看 r.js 说明。
插件
这些都是Requirejs的插件并具有相同的许可条件, 下载插件并添加到你的 "data-main" main.js script.
text下载
加载 text 并将它们添加依赖. 好的加载模板。 可以在加载text字符的时候优化。
domReady下载
等待DOM就绪. 用于暂停上层应用的执行,直到DOM准备好再进行 查询/修改。
cs (CoffeeScript)下载
在 CoffeeScript 加载文件. 有了这个插件, 可以用简单的代码在 CoffeeScript 中转出来运行在浏览器, 它可以参与优化器的优化, 也可以运行 Node 和 Rhino 通过 RequireJS 适配器. 这是进行跨环境的最佳方式,模块 CoffeeScript. 在项目主页 有更多关于如何安装和使用它的信息。
i18nDownload
加载字符串 使用国际化 (i18n) 这需要配置单独的 country/language/locale-specific 文件.
发布说明
2.1.11
一些bug修复,其中最引人注目的除了是一种优化选择,wrapShim。这将包装在一个定义()调用匀依赖关系,因此,他们在创建后更好地工作时,他们的上游依赖性也AMD的模块依赖关系。
最显着的情况下,很可能是使用主干的AMD感知版本时,但使用垫片配置为依赖于骨干脚本。如果这是你的使用情况,然后设置wrapShim: true:真正的优化配置可能会修复任何后期生成问题,您可能会看到。更多详细信息.
更新列表:
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 andexample 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.
Full list of changes:
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
A small release to fix an optimizer issue with parsing config calls for modifications.
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.
Full list of changes:
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.
Full list of changes:
2.1.5
Biggest change is support for running the optimizer and loading AMD modules in xpcshell. Other than that, just a maintenance release.
Full list of changes:
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:
Bug 356: cssPrefix normalization always needs to happen
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.
Full list of changes:
2.1.2
The big changes for this release are in the optimizer:
The optimizer can now run in the browser, to enable web-based custom builds of your library.
"uglify2" is an allowed "optimize" value now, using UglifyJS 2.1.11.
Experimental support for source maps.
The optimizer runs faster now, and has some speed options.
Full list of changes:
2.1.1
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:
require.js: fix for a 'use strict' issue in Safari 6: should only show up in certain non-optimized scenarios.
r.js optimizer: changed over to esprima for all dependency tracing. This set the stage for allowing some forms of JavaScript 1.8 to be optimized, with the help of some regexps.
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
小的错误修复:
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 onBuildWritefunctions 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.
小的错误修复:
1.0.5
小的错误修复:
1.0.4
小的错误修复:
1.0.3
小的错误修复:
1.0.2
小的错误修复:
1.0.1
Just small bug fixes related to:
allowing full URLs for simplified CommonJS wrapped modules
AST parsing of dependencies for modules that use a variable for the factory function
catching more cases that should have the "namespace" optimizer option applied
Detailed list of changes for require.js and the r.js optimizer: