@@ -28,10 +28,11 @@ Download the latest release from the
2828
2929## xpcshell
3030
31- TODO: need an xpcshell.
31+ [ xpcshell] ( https://developer.mozilla.org/en-US/docs/XPConnect/xpcshell ) support
32+ was added in r.js version 2.1.5, so use that r.js version or later.
3233
33- For running tests, put xpcshell in env/xpcshell/ as a directory, that contains
34- all the files needed for it to run, including the xpcshell binary .
34+ Download the latest release of r.js from the
35+ [ RequireJS download page ] ( http://requirejs.org/docs/download.html#rjs ) .
3536
3637## From this repo
3738
@@ -88,6 +89,19 @@ org.mozilla.javascript.tools.shell.Main with
8889
8990All further examples will use the Node notation, but substitute ** r.js** in the commands with the appropriate java command.
9091
92+ ## xpcshell
93+
94+ To run the optimizer using a build config file or command line build options:
95+
96+ path/to/xpcshell path/to/r.js -o buildconfig.js
97+
98+ r.js can also be used as a library in another .js file run via xpcshell.
99+
100+ * [ https://github.com/jrburke/r.js/blob/master/tests/xpcshell/run.js ] : shows how
101+ to load AMD modules by using r.js as a library.
102+ * [ https://github.com/jrburke/r.js/blob/master/tests/xpcshell/build.js ] : shows
103+ how to trigger the optimizer from within another .js file.
104+
91105# Optimizer
92106
93107The optimizer can be run by passing the ** -o** command to r.js:
@@ -191,6 +205,9 @@ and Java/Rhino:
191205 * node ../../r.js all.js
192206 * java -classpath ../../lib/rhino/js.jar:../../lib/closure/compiler.jar org.mozilla.javascript.tools.shell.Main ../../r.js all.js
193207
208+ For running tests, put xpcshell in env/xpcshell/ as a directory, that contains
209+ all the files needed for it to run, including the xpcshell binary.
210+
194211# Contributing code changes
195212
196213See the [ RequireJS Contributing] ( http://requirejs.org/docs/contributing.html )
0 commit comments